/* ============================================================
   Ask Doc — Complete Design System
   Pure CSS, no Tailwind. Uses CSS custom properties throughout.
   ============================================================ */

/* ---- Custom Properties ---- */
:root {
  --color-navy: #1B2B4B;
  --color-navy-light: #2D4270;
  --color-gold: #C9963B;
  --color-gold-light: #E8B96A;
  --color-gold-pale: #FDF4E3;
  --color-cream: #FAF8F3;
  --color-parchment: #F0EBE0;
  --color-text-dark: #1A1A2E;
  --color-text-mid: #4A5568;
  --color-text-soft: #718096;
  --color-border: #E2D9C8;
  --color-success: #2F855A;
  --color-error: #C53030;
  --color-white: #FFFFFF;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);

  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;

  --header-height: 64px;
  --sidebar-width: 260px;
  --right-panel-width: 320px;
  --mobile-tab-height: 0px;

  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Nunito', 'Comic Neue', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-scripture: 'Lora', Georgia, serif;
}

/* ---- Dark Mode ---- */
[data-theme="dark"] {
  --color-navy: #1B2B4B;
  --color-navy-light: #2D4270;
  --color-gold: #D4A84B;
  --color-gold-light: #E8B96A;
  --color-gold-pale: #1A2535;
  --color-cream: #0F1923;
  --color-parchment: #1A2535;
  --color-text-dark: #EDF2F7;
  --color-text-mid: #A0AEC0;
  --color-text-soft: #718096;
  --color-border: #2A3A52;
  --color-success: #48BB78;
  --color-error: #FC8181;
  --color-white: #1E2D3D;

  --shadow-sm: 0 1px 4px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.4);
}

/* Dark mode overrides for hardcoded colors */
[data-theme="dark"] .chat-area::-webkit-scrollbar-thumb { background: #3A4A62; }
[data-theme="dark"] .chat-area::-webkit-scrollbar-thumb:hover { background: #4A5A72; }
[data-theme="dark"] .chat-area { scrollbar-color: #3A4A62 transparent; }

[data-theme="dark"] .bubble-bot {
  background: #1E2D3D;
  border-color: var(--color-border);
}

[data-theme="dark"] .typing-dots {
  background: #1E2D3D;
  border-color: var(--color-border);
}

[data-theme="dark"] .input-bar {
  background: #1A2535;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.15);
}

[data-theme="dark"] .modal-content {
  background: #1A2535;
}

[data-theme="dark"] .modal-close:hover {
  background: #2A3A52;
}

[data-theme="dark"] .modal-note {
  background: #0F1923;
}

[data-theme="dark"] .source-card {
  background: #1E2D3D;
  border-color: var(--color-border);
}

[data-theme="dark"] .source-card-excerpt {
  background: rgba(201, 150, 59, 0.08);
}

[data-theme="dark"] .right-panel {
  background: #1A2535;
  border-color: var(--color-border);
  box-shadow: -4px 0 16px rgba(0,0,0,0.2);
}

[data-theme="dark"] .scroll-to-bottom {
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

[data-theme="dark"] .error-bubble {
  background: #2D1B1B;
  border-color: #5C2A2A;
  color: #FC8181;
}

[data-theme="dark"] .shortcut-row {
  border-bottom-color: rgba(255,255,255,0.06);
}

[data-theme="dark"] .shortcut-row kbd {
  background: #0F1923;
  border-color: var(--color-border);
}

[data-theme="dark"] .sidebar-tab:hover {
  background: rgba(255,255,255,0.04);
}

[data-theme="dark"] .sidebar-tab {
  color: #A0AEC0;
}

[data-theme="dark"] .sidebar-tab.active {
  color: var(--color-gold);
}

/* Header must always have white text (sits on navy bg in both modes) */
[data-theme="dark"] #app-header,
[data-theme="dark"] #app-header .header-title,
[data-theme="dark"] #app-header .header-tagline,
[data-theme="dark"] #app-header .health-text,
[data-theme="dark"] #app-header #sidebar-toggle,
[data-theme="dark"] #app-header #theme-toggle {
  color: #FFFFFF;
}

[data-theme="dark"] #app-header .header-tagline {
  opacity: 0.6;
}

[data-theme="dark"] .new-chat-btn,
[data-theme="dark"] #new-chat-btn {
  color: var(--color-text-dark);
}

/* About modal headings in dark mode */
[data-theme="dark"] #about-modal-title,
[data-theme="dark"] .about-askdoc-section h3,
[data-theme="dark"] .about-coming-soon h3,
[data-theme="dark"] .about-marriage h3 {
  color: var(--color-gold);
}

[data-theme="dark"] .about-bio,
[data-theme="dark"] .about-bio p,
[data-theme="dark"] .about-marriage > p,
[data-theme="dark"] .about-askdoc-section p {
  color: #A0AEC0;
}

[data-theme="dark"] .about-marriage {
  background: rgba(201, 150, 59, 0.08);
}

[data-theme="dark"] .coming-soon-item {
  background: #1E2D3D;
}

[data-theme="dark"] .coming-soon-item strong {
  color: #EDF2F7;
}

/* (old conversation-item styles removed — now using convo-pill) */

[data-theme="dark"] .modal-backdrop {
  background: rgba(0,0,0,0.7);
}

[data-theme="dark"] .verse-popup { background: #1E2D3D; border-color: var(--color-border); }
[data-theme="dark"] .bible-reader { background: #0F1923; border-color: var(--color-border); }
[data-theme="dark"] .bible-reader-header { background: #1A2535; }
[data-theme="dark"] .bible-nav-btn, [data-theme="dark"] .bible-reader-close { background: #0F1923; }
[data-theme="dark"] .memory-verse-card { background: #1E2D3D; }
[data-theme="dark"] .memory-practice-input { background: #0F1923; border-color: var(--color-border); color: #EDF2F7; }
[data-theme="dark"] .sidebar-card { background: #1E2D3D; }
[data-theme="dark"] .sidebar-card strong { color: #EDF2F7; }

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

html, body {
  height: 100%;
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.5;
  color: var(--color-text-dark);
  overflow-x: hidden;
  background: var(--color-cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, textarea {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
}

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

/* ---- Skip Link ---- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  background: var(--color-gold);
  color: var(--color-white);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  z-index: 1000;
  font-weight: 600;
  font-size: 0.875rem;
}

.skip-link:focus {
  top: var(--space-2);
}

/* ---- Focus Styles ---- */
:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
  outline: none;
}


/* ============================================================
   HEADER
   ============================================================ */
#app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 var(--space-5);
  background: linear-gradient(135deg, var(--color-navy), var(--color-navy-light));
  border-bottom: 1px solid rgba(201,150,59,0.3);
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  color: #FFFFFF;
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

#sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  color: var(--color-white);
  transition: background var(--transition-fast);
}

#sidebar-toggle:hover {
  background: rgba(255,255,255,0.1);
}

.header-cross-icon {
  flex-shrink: 0;
}

.header-logo-img {
  height: 40px;
  width: auto;
  flex-shrink: 0;
  filter: brightness(1.1);
}

.header-brand {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.header-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.header-tagline {
  font-size: 11px;
  opacity: 0.6;
  line-height: 1.3;
  white-space: nowrap;
}

/* Header center search */
.header-center {
  flex: 0 1 400px;
  min-width: 0;
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.header-search-wrapper {
  position: relative;
  width: 100%;
  max-width: 400px;
}

.header-search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.5);
  pointer-events: none;
}

#header-search {
  width: 100%;
  height: 36px;
  padding: 0 var(--space-10) 0 36px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-full);
  color: var(--color-white);
  font-size: 0.8125rem;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

#header-search::placeholder {
  color: rgba(255,255,255,0.5);
}

#header-search:focus {
  background: rgba(255,255,255,0.14);
  border-color: rgba(201,150,59,0.5);
  outline: none;
}

.header-search-kbd {
  position: absolute;
  right: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.15);
  pointer-events: none;
}

/* Header right */
.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-shrink: 0;
}

.health-status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.75rem;
  color: rgba(255,255,255,0.7);
}

.health-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #718096;
  flex-shrink: 0;
  transition: background var(--transition-base);
}

.health-dot.online {
  background: var(--color-success);
  animation: pulse-green 2s ease-in-out infinite;
}

.health-dot.error {
  background: var(--color-error);
}

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 0 rgba(47,133,90,0.5); }
  50% { box-shadow: 0 0 0 6px rgba(47,133,90,0); }
}

.health-text {
  white-space: nowrap;
}

#theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.7);
  transition: background var(--transition-fast), color var(--transition-fast);
}

#theme-toggle:hover {
  background: rgba(255,255,255,0.1);
  color: var(--color-white);
}

#profile-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: none;
  border: 2px solid var(--color-gold);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

#profile-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 0 3px rgba(201,150,59,0.3);
}

.header-profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Chat message avatars */
.msg-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--color-gold);
  cursor: pointer;
  transition: transform 0.2s;
}

.msg-avatar:hover {
  transform: scale(1.8);
  z-index: 10;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.msg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.msg-avatar-tag {
  font-size: 0.55rem;
  color: var(--color-text-soft);
  text-align: center;
  margin-top: 2px;
  font-style: italic;
  max-width: 60px;
  line-height: 1.2;
}


/* ============================================================
   APP LAYOUT (Three-Panel Grid)
   ============================================================ */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  height: calc(100vh - var(--header-height));
  overflow: hidden;
  position: relative;
}

/* ============================================================
   LEFT SIDEBAR
   ============================================================ */
#sidebar {
  display: flex;
  flex-direction: column;
  background: var(--color-parchment);
  border-right: 1px solid var(--color-border);
  overflow: visible;
  height: 100%;
}

#sidebar-overlay {
  display: none;
}

.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.sidebar-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-2) var(--space-1);
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--color-text-soft);
  text-align: center;
  border-bottom: 2px solid transparent;
  transition: color var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
  white-space: nowrap;
}

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

.sidebar-tab.active {
  color: var(--color-text-dark);
  border-bottom-color: var(--color-gold);
}

.sidebar-panel {
  display: none;
  flex: 1;
  overflow: hidden;
}

.sidebar-panel.active {
  display: flex;
  flex-direction: column;
}

.sidebar-panel-inner {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Sidebar scrollbar */
.sidebar-panel-inner::-webkit-scrollbar { width: 5px; }
.sidebar-panel-inner::-webkit-scrollbar-track { background: transparent; }
.sidebar-panel-inner::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 3px; }

/* New Chat button */
#new-chat-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: linear-gradient(135deg, var(--color-gold), var(--color-gold-light));
  color: var(--color-white);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

#new-chat-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Conversation List */
.convo-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-2);
}

.convo-section-header {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-soft);
  padding: var(--space-3) var(--space-2) var(--space-1);
}

/* Conversation pill */
.convo-pill {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
  position: relative;
}

.convo-pill:hover {
  background: rgba(0, 0, 0, 0.04);
}

.convo-pill-active {
  background: rgba(201, 150, 59, 0.1);
  border-left: 3px solid var(--color-gold);
}

.convo-pill-icon {
  flex-shrink: 0;
  color: var(--color-text-soft);
}

.convo-pill-active .convo-pill-icon {
  color: var(--color-gold);
}

.convo-pill-title {
  flex: 1;
  font-size: 0.8125rem;
  color: var(--color-text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.convo-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--color-text-soft);
  cursor: pointer;
  opacity: 0;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.convo-pill:hover .convo-dots,
.convo-project-header:hover .convo-dots {
  opacity: 1;
}

.convo-dots:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--color-text-dark);
}

/* Project folder */
.convo-project {
  margin-bottom: var(--space-1);
}

.convo-project-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
  color: var(--color-text-mid);
}

.convo-project-header:hover {
  background: rgba(0, 0, 0, 0.04);
}

.convo-project-name {
  flex: 1;
  font-size: 0.8125rem;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.convo-project-count {
  font-size: 0.625rem;
  color: var(--color-text-soft);
  background: var(--color-border);
  border-radius: 8px;
  padding: 1px 6px;
  min-width: 16px;
  text-align: center;
}

.convo-project-items {
  padding-left: var(--space-4);
}

.convo-project-items[hidden] {
  display: none;
}

/* Dropdown menu */
.convo-menu {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  padding: var(--space-1);
  animation: fadeSlideUp var(--transition-fast) ease;
}

.convo-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border: none;
  background: none;
  font-size: 0.8125rem;
  color: var(--color-text-dark);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.convo-menu-item:hover {
  background: var(--color-parchment);
}

.convo-menu-danger {
  color: var(--color-error);
}

.convo-menu-danger:hover {
  background: rgba(197, 48, 48, 0.08);
}

/* Dark mode conversation sidebar */
[data-theme="dark"] .convo-pill:hover { background: rgba(255, 255, 255, 0.05); }
[data-theme="dark"] .convo-pill-active { background: rgba(201, 150, 59, 0.15); }
[data-theme="dark"] .convo-project-header:hover { background: rgba(255, 255, 255, 0.05); }
[data-theme="dark"] .convo-project-count { background: rgba(255, 255, 255, 0.1); }
[data-theme="dark"] .convo-dots:hover { background: rgba(255, 255, 255, 0.1); color: #EDF2F7; }
[data-theme="dark"] .convo-menu { background: #1E2D3D; border-color: var(--color-border); }
[data-theme="dark"] .convo-menu-item { color: #EDF2F7; }
[data-theme="dark"] .convo-menu-item:hover { background: rgba(255, 255, 255, 0.06); }

/* New Project button */
.sidebar-new-project-btn {
  width: 100%;
  padding: 6px 12px;
  margin-bottom: 8px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-soft);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.sidebar-new-project-btn:hover {
  border-color: var(--color-gold);
  color: var(--color-gold);
}

/* Pinned section pin icon */
.convo-pin-icon {
  color: var(--color-gold);
  flex-shrink: 0;
}

/* Tooltip on hover */
.convo-pill[data-tooltip] {
  position: relative;
}
/* Settings link at bottom of sidebar */
.sidebar-settings {
  padding: var(--space-3);
  border-top: 1px solid var(--color-border);
  margin-top: auto;
}
.sidebar-settings-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: none;
  background: transparent;
  color: var(--color-text-soft);
  font-size: 0.75rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.sidebar-settings-btn:hover {
  color: var(--color-text-mid);
  background: rgba(0,0,0,0.04);
}
[data-theme="dark"] .sidebar-settings-btn:hover {
  background: rgba(255,255,255,0.05);
}

/* Project modal form */
.project-modal-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--color-text-dark);
  margin-bottom: var(--space-5);
}

.project-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.project-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.project-input {
  padding: var(--space-3);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-cream);
  color: var(--color-text-dark);
  font-size: 0.9rem;
  font-family: var(--font-body);
}
.project-input:focus {
  outline: none;
  border-color: var(--color-gold);
}

[data-theme="dark"] .project-input {
  background: #0F1923;
  border-color: var(--color-border);
  color: #EDF2F7;
}

.project-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-cat-btn {
  padding: 6px 12px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-text-mid);
  font-size: 0.75rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.project-cat-btn:hover {
  border-color: var(--color-gold);
  color: var(--color-gold);
}
.project-cat-btn.selected {
  background: var(--color-gold);
  color: white;
  border-color: var(--color-gold);
}

.project-create-btn {
  margin-top: var(--space-3);
  padding: var(--space-3);
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-gold);
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.project-create-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.project-create-btn:not(:disabled):hover {
  background: var(--color-gold-light);
}

/* Conversation tooltip — matches cloud styling */
/* convo-pill tooltip handled by JS (not CSS ::after) to escape overflow */
.convo-pill[data-tooltip]:hover::after {
  display: none !important;
}

/* JS tooltip element */
.js-tooltip {
  position: fixed;
  padding: 10px 14px;
  background: rgba(232, 226, 215, 0.97);
  color: #1A202C;
  border: 1.5px solid rgba(201, 150, 59, 0.3);
  border-radius: 16px;
  font-size: 0.7rem;
  font-family: var(--font-body);
  font-weight: 600;
  line-height: 1.5;
  max-width: 260px;
  white-space: pre-wrap;
  z-index: 9999;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  pointer-events: none;
  animation: fadeSlideIn 0.15s ease;
}

[data-theme="dark"] .js-tooltip {
  background: rgba(42, 61, 85, 0.97);
  color: #E2E8F0;
  border-color: rgba(201, 150, 59, 0.4);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

/* Global tooltip style -- ALL tooltips match cloud design */
[data-tooltip] {
  position: relative;
}
[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  padding: 10px 14px;
  background: rgba(232, 226, 215, 0.95);
  color: #1A202C;
  border: 1.5px solid rgba(201, 150, 59, 0.3);
  border-radius: 16px;
  font-size: 0.7rem;
  font-family: var(--font-body);
  font-weight: 600;
  line-height: 1.4;
  max-width: 240px;
  white-space: pre-wrap;
  z-index: 100;
  box-shadow: var(--shadow-md);
  pointer-events: none;
}

[data-theme="dark"] [data-tooltip]:hover::after {
  background: rgba(42, 61, 85, 0.95);
  color: #E2E8F0;
  border-color: rgba(201, 150, 59, 0.4);
}

/* Sidebar search */
.sidebar-search-wrapper {
  position: relative;
  flex-shrink: 0;
}

.sidebar-search-wrapper svg {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-soft);
  pointer-events: none;
}

#sermon-search-input {
  width: 100%;
  height: 38px;
  padding: 0 var(--space-4) 0 36px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  color: var(--color-text-dark);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

#sermon-search-input::placeholder {
  color: var(--color-text-soft);
}

#sermon-search-input:focus {
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(201,150,59,0.15);
}

/* Sermon results */
.sermon-results {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.sidebar-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-10) var(--space-4);
  gap: var(--space-3);
}

.sidebar-empty-state p {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-mid);
}

.sidebar-empty-state span {
  font-size: 0.75rem;
  color: var(--color-text-soft);
}

/* Sermon card */
.sermon-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
  animation: fadeSlideIn var(--transition-slow) ease both;
}

.sermon-card:nth-child(2) { animation-delay: 50ms; }
.sermon-card:nth-child(3) { animation-delay: 100ms; }
.sermon-card:nth-child(4) { animation-delay: 150ms; }
.sermon-card:nth-child(5) { animation-delay: 200ms; }

.sermon-card:hover {
  border-color: var(--color-gold);
  box-shadow: var(--shadow-sm);
}

.sermon-card-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-navy);
  margin-bottom: var(--space-1);
}

.sermon-card-meta {
  font-size: 0.6875rem;
  color: var(--color-text-soft);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.sermon-card-scripture {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--color-gold);
  background: var(--color-gold-pale);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  margin-top: var(--space-1);
}

.sermon-card-excerpt {
  font-size: 0.75rem;
  color: var(--color-text-mid);
  margin-top: var(--space-2);
  line-height: 1.5;
}

/* Topic pills */
.topic-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.topic-pill {
  height: 28px;
  padding: 0 var(--space-4);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-mid);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.topic-pill:hover {
  background: var(--color-gold);
  color: var(--color-white);
  border-color: var(--color-gold);
}

.topic-pill.active {
  background: var(--color-gold);
  color: var(--color-white);
  border-color: var(--color-gold);
}

/* Sidebar footer */
.sidebar-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-3) var(--space-4);
  flex-shrink: 0;
}

.sidebar-about-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.8125rem;
  color: var(--color-text-soft);
  padding: var(--space-2) 0;
  transition: color var(--transition-fast);
}

.sidebar-about-link:hover {
  color: var(--color-gold);
}


/* ============================================================
   CENTER CHAT
   ============================================================ */
.chat-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
  overflow: hidden;
}

.chat-area {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-6) var(--space-6) var(--space-4);
  position: relative;
  scroll-behavior: smooth;
}

/* Cross watermark — large, centered in chat panel, always visible */
.chat-area::after {
  content: '';
  position: fixed;
  top: var(--header-height);
  bottom: 0;
  left: var(--sidebar-width);
  right: 0;
  background: url('/images/cross.png') no-repeat center center;
  background-size: auto 80%;
  opacity: 0.04;
  pointer-events: none;
  z-index: 0;
}

[data-theme="dark"] .chat-area::after {
  opacity: 0.035;
  filter: invert(1);
}

/* Scrollbar */
.chat-area::-webkit-scrollbar { width: 6px; }
.chat-area::-webkit-scrollbar-track { background: transparent; }
.chat-area::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
.chat-area::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
.chat-area { scrollbar-width: thin; scrollbar-color: #d1d5db transparent; }

/* Cross watermark — removed, now handled via .chat-area background-image + ::before overlay */

/* Make all content areas translucent so cross shows through gently */
/* AI response — no bubble background, just clean text */
.bubble-ai {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: var(--space-2) 0 !important;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  word-spacing: 0.08em;
  line-height: 1.8;
}

[data-theme="dark"] .bubble-user {
  background: none !important;
  color: var(--color-gold) !important;
  border-left: 3px solid var(--color-gold);
}

[data-theme="dark"] .bubble-ai {
  background: transparent !important;
  color: #EDF2F7 !important;
}

[data-theme="dark"] .ai-para {
  color: #E2E8F0;
}

.ai-para {
  font-size: 1.05rem;
  line-height: 1.85;
  word-spacing: 0.08em;
}

.scripture-quote {
  background: rgba(253, 244, 227, 0.75) !important;
}

[data-theme="dark"] .scripture-quote {
  background: rgba(26, 37, 53, 0.75) !important;
}

.daily-verse {
  background: rgba(253, 244, 227, 0.7) !important;
}

[data-theme="dark"] .daily-verse {
  background: rgba(26, 37, 53, 0.7) !important;
}

.suggestion-card {
  background: rgba(255, 255, 255, 0.8) !important;
}

[data-theme="dark"] .suggestion-card {
  background: rgba(30, 45, 61, 0.8) !important;
}

/* Typewriter animation for AI responses */
@keyframes typeReveal {
  from { max-height: 0; opacity: 0; }
  to { max-height: 2000px; opacity: 1; }
}

.bubble-ai.typing-reveal {
  overflow: hidden;
  animation: typeReveal 0.8s ease forwards;
}

.bubble-ai .ai-para {
  animation: fadeSlideIn 0.4s ease both;
}

.bubble-ai .ai-para:nth-child(1) { animation-delay: 0s; }
.bubble-ai .ai-para:nth-child(2) { animation-delay: 0.3s; }
.bubble-ai .ai-para:nth-child(3) { animation-delay: 0.6s; }
.bubble-ai .ai-para:nth-child(4) { animation-delay: 0.9s; }
.bubble-ai .ai-para:nth-child(5) { animation-delay: 1.2s; }

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Welcome State ---- */
.welcome-state {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-10) var(--space-4);
  max-width: 640px;
  margin: 0 auto;
}

.welcome-state[hidden] {
  display: none;
}

/* Welcome photo -- 25% of viewport width, circular */
.welcome-photo {
  width: 25vw;
  max-width: 200px;
  min-width: 100px;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--color-gold);
  margin-bottom: var(--space-4);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.welcome-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Welcome hero: photo beside quote */
.welcome-hero {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  margin: var(--space-4) 0;
  text-align: left;
}

.welcome-hero-quote {
  flex: 1;
}

.welcome-book-link {
  display: inline-block;
  margin-top: var(--space-2);
  padding: 2px 10px;
  border: 1px solid rgba(201, 150, 59, 0.3);
  border-radius: var(--radius-full);
  color: var(--color-gold);
  font-size: 0.65rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.welcome-book-link:hover {
  background: var(--color-gold);
  color: white;
  border-color: var(--color-gold);
}

@media (max-width: 600px) {
  .welcome-hero {
    flex-direction: column;
    text-align: center;
  }
}

/* Doc quote on welcome screen */
.welcome-quote {
  max-width: 500px;
  margin: var(--space-4) auto;
  padding: var(--space-4) var(--space-5);
  background: var(--color-gold-pale);
  border-left: 4px solid var(--color-gold);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.welcome-quote-text {
  font-family: var(--font-scripture);
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--color-text-dark);
  margin-bottom: var(--space-2);
}

.welcome-quote-attr {
  font-size: 0.75rem;
  color: var(--color-gold);
  font-weight: 600;
}

[data-theme="dark"] .welcome-quote {
  background: rgba(201, 150, 59, 0.08);
}

.welcome-icon {
  margin-bottom: var(--space-6);
}

.welcome-heading {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: var(--space-2);
}

.welcome-subheading {
  font-size: 1rem;
  color: var(--color-text-mid);
  margin-bottom: var(--space-8);
  max-width: 420px;
}

/* Daily verse */
.daily-verse {
  background: var(--color-gold-pale);
  border-left: 4px solid var(--color-gold);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-5);
  margin-bottom: var(--space-8);
  width: 100%;
  max-width: 500px;
  text-align: left;
}

.daily-verse-text {
  font-family: var(--font-scripture);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--color-text-dark);
  line-height: 1.8;
  margin-bottom: var(--space-3);
}

.daily-verse-ref {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-gold);
}

/* Floating cloud suggestion bubbles */
.floating-suggestions {
  position: fixed;
  top: var(--header-height);
  bottom: 80px;
  left: var(--sidebar-width);
  right: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 2;
}

/* Thought cloud bubbles — SVG cloud img wraps the text */
.float-cloud {
  position: absolute;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  pointer-events: auto;
  animation: cloudRise 65s linear forwards;
  transition: filter 0.2s, transform 0.2s;
}

.float-cloud:hover {
  filter: drop-shadow(0 4px 12px rgba(201,150,59,0.3));
  transform: scale(1.05);
  z-index: 10;
}

/* Cloud img wraps around and well beyond the text */
.cloud-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 160px;
  min-height: 65px;
  overflow: visible;
}

.float-cloud {
  overflow: visible;
}

.cloud-img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -46%);
  width: calc(100% + 90px);
  height: calc(100% + 80px);
  min-width: 200px;
  min-height: 130px;
  object-fit: fill;
  pointer-events: none;
}

.cloud-text {
  position: relative;
  z-index: 1;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  padding: 4px 4px;
  font-size: 0.66rem;
  font-family: var(--font-body);
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
  color: #1A202C;
  width: 88%;
  min-height: 55px;
  margin-top: 16px;
  word-wrap: break-word;
  overflow: hidden;
  -webkit-box-orient: vertical;
}

/* Dark mode */
[data-theme="dark"] .cloud-text { color: #E2E8F0; }
[data-theme="dark"] .float-cloud:hover .cloud-text { color: #F7FAFC; }

/* Hide JS-generated dots — SVG files have built-in trailing dots */
.cloud-dots { display: none; }

.cloud-dots span:first-child {
  width: 10px; height: 10px;
  margin-bottom: 4px;
}
.cloud-dots span:last-child {
  width: 6px; height: 6px;
  margin-left: 3px;
}

/* Left-side clouds: dots on bottom-left */
.float-cloud .cloud-dots { left: 12px; }
/* Right-side clouds: dots on bottom-right */
.float-cloud.cloud-right .cloud-dots { left: auto; right: 12px; }

@keyframes cloudRise {
  0%   { bottom: -80px; opacity: 0; transform: translateX(0); }
  4%   { opacity: 1; }
  10%  { transform: translateX(5px); }
  25%  { transform: translateX(-4px); }
  40%  { transform: translateX(4px); }
  55%  { transform: translateX(-3px); }
  70%  { transform: translateX(3px); }
  85%  { transform: translateX(-2px); }
  92%  { opacity: 1; }
  100% { bottom: 105%; opacity: 0; transform: translateX(0); }
}

/* Dark mode — .float-cloud stays transparent, only .cloud-body has the SVG background */
[data-theme="dark"] .cloud-dots span {
  background: rgba(35, 55, 80, 0.8);
  border-color: rgba(201, 150, 59, 0.2);
}

/* Narrow screens: hide sidebar, clouds use full width edges */
@media (max-width: 1024px) {
  .floating-suggestions {
    left: 0;
  }
}

/* Hide clouds on mobile, show suggestion bar instead */
@media (max-width: 767px) {
  .floating-suggestions { display: none; }

  .mobile-suggestion-bar {
    display: flex;
  }
}

/* Mobile suggestion bar -- rotating question button */
.mobile-suggestion-bar {
  display: none;
  position: fixed;
  bottom: 80px;
  left: 0;
  right: 0;
  padding: 8px 16px;
  z-index: 3;
  justify-content: center;
}

.mobile-suggestion-btn {
  padding: 10px 20px;
  background: rgba(232, 226, 215, 0.9);
  border: 1.5px solid rgba(201, 150, 59, 0.3);
  border-radius: var(--radius-lg);
  color: #1A202C;
  font-size: 0.8rem;
  font-family: var(--font-body);
  font-weight: 600;
  text-align: center;
  line-height: 1.4;
  cursor: pointer;
  max-width: 300px;
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  animation: suggestionFade 3s ease infinite;
}

.mobile-suggestion-btn:hover {
  border-color: var(--color-gold);
  background: rgba(232, 226, 215, 1);
}

[data-theme="dark"] .mobile-suggestion-btn {
  background: rgba(42, 61, 85, 0.9);
  color: #E2E8F0;
  border-color: rgba(201, 150, 59, 0.4);
}

@keyframes suggestionFade {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .float-cloud { animation: none !important; opacity: 0.5; }
}

.suggestion-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-dark);
  line-height: 1.4;
}

/* suggestion-hint removed — floating bubbles don't use hints */


/* ---- Chat Messages ---- */
#chat-messages {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  max-width: 580px;
  margin: 0 auto;
  width: 100%;
  padding-bottom: 60px;
  padding-top: 20px;
}

/* Message wrapper */
.chat-message {
  display: flex;
  gap: var(--space-3);
  max-width: 100%;
}

.chat-message.user {
  justify-content: flex-end;
  animation: slideInRight var(--transition-slow) ease both;
}

.chat-message.assistant {
  justify-content: flex-start;
  animation: slideInUp var(--transition-slow) ease both;
}

/* Avatar */
.msg-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-navy), var(--color-navy-light));
  color: var(--color-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.025em;
  flex-shrink: 0;
  align-self: flex-start;
}

/* Bubbles */
.bubble-user {
  background: none;
  color: var(--color-gold);
  font-weight: 600;
  font-size: 1.1rem;
  border: none;
  border-left: 3px solid var(--color-gold);
  border-radius: 0;
  padding: var(--space-2) var(--space-4);
  max-width: 72%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.bubble-bot {
  position: relative;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 4px 18px 18px 18px;
  padding: var(--space-4) var(--space-5);
  max-width: 82%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--color-text-dark);
  box-shadow: var(--shadow-sm);
}

/* Scripture in AI messages */
.scripture-block {
  background: var(--color-gold-pale);
  border-left: 3px solid var(--color-gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: var(--space-3) var(--space-4);
  margin: var(--space-3) 0;
  font-family: var(--font-scripture);
  font-style: italic;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--color-text-dark);
}

.scripture-ref {
  display: block;
  font-family: var(--font-body);
  font-style: normal;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-gold);
  margin-top: var(--space-2);
}

/* Citation chips */
.citation-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.citation-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 3px var(--space-3);
  background: var(--color-cream);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  color: var(--color-text-mid);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  line-height: 1.4;
}

.citation-chip:hover {
  background: var(--color-gold-pale);
  border-color: var(--color-gold);
  color: var(--color-navy);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.citation-chip svg {
  flex-shrink: 0;
}

/* Copy button (on hover) */
.msg-copy-btn {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--color-cream);
  border: 1px solid var(--color-border);
  color: var(--color-text-soft);
  opacity: 0;
  transition: opacity var(--transition-fast), background var(--transition-fast);
}

.bubble-bot:hover .msg-copy-btn {
  opacity: 1;
}

.msg-copy-btn:hover {
  background: var(--color-gold-pale);
  color: var(--color-gold);
}

.msg-copy-btn.copied {
  color: var(--color-success);
}

/* Feedback buttons */
.msg-feedback {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.chat-message.assistant:hover .msg-feedback {
  opacity: 1;
}

.msg-feedback button {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--color-text-soft);
  transition: all var(--transition-fast);
}

.msg-feedback button:hover {
  background: var(--color-gold-pale);
  color: var(--color-gold);
}

.msg-feedback button.active {
  color: var(--color-gold);
}

/* ---- Source Pills ---- */
.source-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.source-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-parchment);
  color: var(--color-text-mid);
  font-size: 12px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.source-pill:hover {
  background: var(--color-gold);
  color: white;
  border-color: var(--color-gold);
}

.source-pill-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-navy);
  color: white;
  font-size: 10px;
  font-weight: 600;
}

.source-pill-more {
  background: transparent;
  border-style: dashed;
  color: var(--color-text-soft);
}

/* ---- Message Action Buttons ---- */
.message-actions {
  display: none; /* replaced by .msg-toolbar */
}

/* Compact action toolbar */
.msg-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 4px;
  opacity: 0.5;
  transition: opacity var(--transition-fast);
}

.message-row:hover .msg-toolbar,
.msg-toolbar:focus-within {
  opacity: 1;
}

/* Error message with retry */
.error-message {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: rgba(197, 48, 48, 0.08);
  border: 1px solid rgba(197, 48, 48, 0.2);
  border-radius: var(--radius-md);
  max-width: 580px;
}

.error-text {
  font-size: 0.85rem;
  color: var(--color-error);
}

.retry-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border: 1.5px solid var(--color-gold);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-gold);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.retry-btn:hover {
  background: var(--color-gold);
  color: white;
}

[data-theme="dark"] .error-message {
  background: rgba(197, 48, 48, 0.12);
  border-color: rgba(197, 48, 48, 0.3);
}

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border: none;
  background: transparent;
  color: var(--color-text-soft);
  font-size: 0.6875rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.toolbar-btn:hover {
  color: var(--color-gold);
  background: var(--color-gold-pale);
}

.tell-more-btn {
  color: var(--color-gold) !important;
  font-weight: 700;
  opacity: 1 !important;
  border: 1px solid rgba(201, 150, 59, 0.3);
  border-radius: var(--radius-full);
  padding: 4px 12px !important;
  animation: tellMorePulse 2s ease infinite;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tell-more-btn:hover {
  background: var(--color-gold) !important;
  color: white !important;
  border-color: var(--color-gold);
  animation: none;
  transform: scale(1.05);
}

@keyframes tellMorePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201, 150, 59, 0.3); }
  50% { box-shadow: 0 0 0 4px rgba(201, 150, 59, 0); }
}

/* ── Unified Gospel Stage Button ── */

.gospel-stage-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  border: 1px solid rgba(201, 150, 59, 0.4);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  background: transparent;
  color: var(--color-gold);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s, background 0.3s;
  animation: gospelStagePulse 2s ease infinite;
}

.gospel-stage-btn:hover {
  background: var(--color-gold);
  color: white;
  transform: scale(1.08);
}

.gospel-stage-hook {
  margin-bottom: 6px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-gold);
  text-align: center;
  animation: gospelHookPulse 2s ease infinite;
}

@keyframes gospelHookPulse {
  0%, 100% { opacity: 1; text-shadow: 0 0 0 transparent; }
  50% { opacity: 0.7; text-shadow: 0 0 12px rgba(201, 150, 59, 0.6); }
}

@keyframes gospelStagePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201, 150, 59, 0.3); }
  50% { box-shadow: 0 0 0 6px rgba(201, 150, 59, 0); }
}

/* Stage progression — subtle intensity increase */
.gospel-stage-1 {
  animation: gospelStagePulse 2s ease infinite;
}

.gospel-stage-2 {
  border-color: rgba(201, 150, 59, 0.6);
  animation: gospelStage2Pulse 1.8s ease infinite;
}
@keyframes gospelStage2Pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(201, 150, 59, 0.4);
    text-shadow: none;
  }
  50% {
    box-shadow: 0 0 0 7px rgba(201, 150, 59, 0);
    text-shadow: 0 0 6px rgba(201, 150, 59, 0.3);
  }
}

.gospel-stage-3 {
  border-color: var(--color-gold);
  background: rgba(201, 150, 59, 0.06);
  animation: gospelStage3Pulse 1.5s ease infinite;
}
@keyframes gospelStage3Pulse {
  0%, 100% {
    box-shadow: 0 0 4px rgba(201, 150, 59, 0.3), 0 0 0 0 rgba(201, 150, 59, 0.4);
    text-shadow: none;
  }
  50% {
    box-shadow: 0 0 10px rgba(201, 150, 59, 0.5), 0 0 0 8px rgba(201, 150, 59, 0);
    text-shadow: 0 0 8px rgba(201, 150, 59, 0.4);
  }
}

.gospel-stage-final {
  border: 2px solid #48BB78;
  background: linear-gradient(135deg, #2F855A, #48BB78);
  color: white;
  animation: gospelStageFinalPulse 1.2s ease infinite;
}
.gospel-stage-final:hover {
  background: linear-gradient(135deg, #48BB78, #2F855A);
  color: white;
}
@keyframes gospelStageFinalPulse {
  0%, 100% {
    box-shadow: 0 0 6px rgba(47, 133, 90, 0.4), 0 0 0 0 rgba(47, 133, 90, 0.5);
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.3);
  }
  50% {
    box-shadow: 0 0 16px rgba(47, 133, 90, 0.7), 0 0 0 10px rgba(47, 133, 90, 0);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
  }
}

/* Urgency after 15 seconds — faster pulse */
.gospel-stage-urgent {
  animation-duration: 0.8s !important;
}

[data-theme="dark"] .toolbar-btn:hover {
  background: rgba(201, 150, 59, 0.15);
}

/* Thumbs up/down active states */
.thumb-up-active {
  color: #2F855A !important;
  background: rgba(47,133,90,0.12) !important;
  transition: transform 0.3s ease, color 0.2s;
}

.thumb-down-active {
  color: #C53030 !important;
  background: rgba(197,48,48,0.12) !important;
  transition: transform 0.3s ease, color 0.2s;
}

/* Feedback reason picker */
.feedback-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  padding: 10px;
  background: var(--color-parchment);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  animation: fadeSlideIn 0.2s ease;
}

[data-theme="dark"] .feedback-reasons {
  background: #1E2D3D;
}

.feedback-reasons-label {
  width: 100%;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-text-soft);
  margin-bottom: 2px;
}

.feedback-reason-btn {
  padding: 5px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-white);
  color: var(--color-text-mid);
  font-size: 0.68rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.feedback-reason-btn:hover {
  border-color: var(--color-error);
  color: var(--color-error);
  background: rgba(197,48,48,0.06);
}

[data-theme="dark"] .feedback-reason-btn {
  background: #0F1923;
}

.feedback-thanks {
  font-size: 0.7rem;
  color: var(--color-gold);
  font-weight: 600;
}

.view-sources-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-gold);
  background: transparent;
  color: var(--color-gold);
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition-base);
}

.view-sources-btn:hover {
  background: var(--color-gold);
  color: white;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-parchment);
  color: var(--color-text-soft);
  cursor: pointer;
  transition: all var(--transition-base);
}

.action-btn:hover {
  border-color: var(--color-gold);
  color: var(--color-gold);
  background: var(--color-gold-pale);
}

.action-btn.active {
  background: var(--color-gold);
  color: white;
  border-color: var(--color-gold);
}

/* ---- Follow-up Question Suggestions ---- */
.follow-up-questions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

.follow-up-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-parchment);
  color: var(--color-text-dark);
  font-size: 13px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition-base);
  text-align: left;
  line-height: 1.3;
}

.follow-up-btn:hover {
  border-color: var(--color-gold);
  background: var(--color-gold-pale);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.follow-up-btn::before {
  content: '\2192';
  color: var(--color-gold);
  font-weight: 600;
}


/* ---- Typing Indicator ---- */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  max-width: 580px;
  position: relative;
  z-index: 1;
  margin: 0 auto;
  width: 100%;
}

.typing-indicator[hidden] {
  display: none !important;
}

.typing-indicator.visible {
  display: flex !important;
}

.typing-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-navy), var(--color-navy-light));
  color: var(--color-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.typing-dots {
  display: flex;
  gap: 4px;
  padding: var(--space-3) var(--space-4);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 4px 18px 18px 18px;
  box-shadow: var(--shadow-sm);
}

.typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-gold);
  animation: typingPulse 1.4s ease-in-out infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingPulse {
  0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
  30% { opacity: 1; transform: scale(1); }
}


/* ---- Scroll to Bottom ---- */
.scroll-to-bottom {
  position: absolute;
  bottom: 100px;
  right: var(--space-6);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-gold);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  z-index: 10;
}

.scroll-to-bottom[hidden] {
  display: none;
}

.scroll-to-bottom:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-lg);
}


/* ---- Input Bar ---- */
.input-bar {
  border-top: 1px solid var(--color-border);
  background: var(--color-white);
  box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
  padding: var(--space-4) var(--space-6);
  flex-shrink: 0;
  position: relative;
  z-index: 5;
}

.input-form {
  max-width: 580px;
  margin: 0 auto;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: var(--space-3);
}

/* Cycling placeholder -- hidden overlay, text goes directly in textarea */
.input-cycling-placeholder {
  display: none;
}

/* Gold italic style for cycling suggestions typed into textarea */
#question-input.showing-suggestion {
  color: var(--color-gold) !important;
  font-style: italic;
}

.input-icon {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

#question-input {
  flex: 1;
  min-height: 44px;
  max-height: 150px;
  padding: var(--space-3) var(--space-4) var(--space-3) 42px;
  background: var(--color-cream);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  font-size: 0.9375rem;
  color: var(--color-text-dark);
  resize: none;
  overflow-y: hidden;
  line-height: 1.5;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

#question-input::placeholder {
  color: var(--color-text-soft);
}

#question-input:focus {
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(201,150,59,0.12);
  outline: none;
}

#send-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-gold), var(--color-gold-light));
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-base), transform var(--transition-fast), box-shadow var(--transition-fast);
  flex-shrink: 0;
}

#send-btn:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

#send-btn.has-text {
  background: linear-gradient(135deg, var(--color-navy), var(--color-navy-light));
}

#send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Suggestion nav arrows */
.suggestion-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}

.sugg-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 18px;
  border: none;
  background: transparent;
  color: var(--color-text-soft);
  cursor: pointer;
  border-radius: 4px;
  transition: all var(--transition-fast);
  opacity: 0.5;
}

.sugg-nav-btn:hover {
  color: var(--color-gold);
  opacity: 1;
}

/* Mic button */
.mic-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--color-border);
  background: transparent;
  color: var(--color-text-soft);
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.mic-btn:hover {
  border-color: var(--color-gold);
  color: var(--color-gold);
}

.mic-btn.mic-active {
  border-color: var(--color-error);
  color: var(--color-error);
  background: rgba(197, 48, 48, 0.08);
  animation: micPulse 1.5s ease infinite;
}

@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(197, 48, 48, 0.3); }
  50% { box-shadow: 0 0 0 6px rgba(197, 48, 48, 0); }
}

.input-disclaimer {
  font-size: 0.6875rem;
  color: var(--color-text-soft);
  text-align: center;
  margin-top: var(--space-2);
}


/* ============================================================
   RIGHT PANEL
   ============================================================ */
.right-panel {
  position: fixed;
  top: var(--header-height);
  right: 0;
  bottom: 0;
  width: var(--right-panel-width);
  background: var(--color-white);
  border-left: 1px solid var(--color-border);
  box-shadow: -4px 0 16px rgba(0,0,0,0.06);
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  z-index: 30;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.right-panel.right-panel-open {
  transform: translateX(0);
}

.right-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.right-panel-header h3 {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-soft);
}

#right-panel-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--color-text-soft);
  transition: all var(--transition-fast);
}

#right-panel-close:hover {
  background: var(--color-cream);
  color: var(--color-text-dark);
}

.right-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
}

.right-panel-body::-webkit-scrollbar { width: 5px; }
.right-panel-body::-webkit-scrollbar-track { background: transparent; }
.right-panel-body::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 3px; }

/* Source cards */
.right-panel-sources {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.source-card {
  background: var(--color-parchment);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-gold);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  position: relative;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.source-card:hover {
  border-color: var(--color-gold-light);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.source-badge {
  position: absolute;
  top: -8px;
  left: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-gold);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.source-card-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--color-gold);
  float: left;
  margin-right: var(--space-3);
}

.source-card-title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-gold);
  margin-bottom: 2px;
}

.source-card-series {
  font-size: 0.7rem;
  font-style: italic;
  color: var(--color-text-soft);
}

.source-card-meta {
  font-size: 0.65rem;
  color: var(--color-text-soft);
  margin: var(--space-1) 0;
  display: flex;
  gap: var(--space-2);
  align-items: center;
  clear: both;
}

.source-relevance {
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: rgba(201, 150, 59, 0.15);
  color: var(--color-gold);
  font-size: 0.6rem;
  font-weight: 700;
}

.source-card-excerpt {
  font-family: var(--font-scripture);
  font-style: italic;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--color-text-mid);
  padding: var(--space-3);
  background: var(--color-gold-pale);
  border-left: 3px solid var(--color-gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: var(--space-3) 0;
}

.source-card-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.source-action-btn {
  padding: 4px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-text-soft);
  font-size: 0.65rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.source-action-btn:hover {
  border-color: var(--color-gold);
  color: var(--color-gold);
}

/* Bible source specific */
.source-card-bible-icon {
  color: var(--color-gold);
  float: left;
  margin-right: var(--space-2);
}

/* Explore further */
.right-panel-explore {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

.right-panel-explore h4 {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-soft);
  margin-bottom: var(--space-3);
}

.right-panel-topics {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.followup-chip {
  font-size: 0.75rem;
  padding: var(--space-2) var(--space-3);
  background: var(--color-cream);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text-mid);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.followup-chip:hover {
  background: var(--color-gold-pale);
  border-color: var(--color-gold);
  color: var(--color-navy);
}


/* ============================================================
   MODALS
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn var(--transition-base) ease;
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--color-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  animation: scaleIn var(--transition-slow) ease;
}

.modal-content-sm {
  max-width: 440px;
}

.modal-content-lg {
  max-width: 720px;
}

.modal-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--color-text-soft);
  transition: all var(--transition-fast);
  z-index: 1;
}

.modal-close:hover {
  background: var(--color-cream);
  color: var(--color-text-dark);
}

.modal-body {
  padding: var(--space-10) var(--space-8);
  text-align: center;
}

.modal-icon {
  margin-bottom: var(--space-5);
}

.modal-body h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: var(--space-4);
}

.modal-description {
  font-size: 0.9375rem;
  color: var(--color-text-mid);
  line-height: 1.7;
  margin-bottom: var(--space-8);
}

/* Modal stats */
.modal-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

.modal-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modal-stat-number {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-gold);
}

.modal-stat-label {
  font-size: 0.75rem;
  color: var(--color-text-soft);
  margin-top: var(--space-1);
}

.modal-stat-divider {
  width: 1px;
  height: 40px;
  background: var(--color-border);
}

.modal-note {
  background: var(--color-cream);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.modal-note p {
  font-size: 0.8125rem;
  color: var(--color-text-soft);
  line-height: 1.6;
}

/* About modal — rich bio layout */
.about-body {
  max-height: 75vh;
  overflow-y: auto;
}

.about-hero {
  margin: calc(-1 * var(--space-8)) calc(-1 * var(--space-8)) var(--space-6);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  overflow: hidden;
  max-height: 280px;
}

.about-hero-img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  object-position: center 5%;
  display: block;
}

.about-bio {
  font-size: 0.9375rem;
  color: var(--color-text-mid);
  line-height: 1.7;
  margin-bottom: var(--space-6);
}

.about-bio p {
  margin-bottom: var(--space-3);
}

.about-bio em {
  color: var(--color-gold);
  font-style: italic;
}

.about-photo-row {
  display: flex;
  gap: var(--space-5);
  margin-bottom: var(--space-4);
  align-items: flex-start;
}

.about-portrait {
  width: 140px;
  height: auto;
  border-radius: var(--radius-lg);
  object-fit: contain;
  flex-shrink: 0;
  border: 3px solid var(--color-gold);
}

.about-intro {
  flex: 1;
}

/* Marriage / family section */
.about-marriage {
  margin: var(--space-6) 0;
  padding: var(--space-5);
  background: var(--color-gold-pale);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--color-gold);
}

.about-marriage h3 {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  color: var(--color-gold);
  margin-bottom: var(--space-2);
}

.about-marriage > p {
  font-size: 0.875rem;
  color: var(--color-text-mid);
  line-height: 1.7;
  margin-bottom: var(--space-4);
}

.marriage-photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.marriage-photo-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition-base);
}

.marriage-photo-card:hover,
.marriage-photo-card:focus-visible {
  border-color: var(--color-gold);
  transform: scale(1.03);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  z-index: 2;
}

.marriage-photo {
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  display: block;
  transition: transform var(--transition-slow);
  background: var(--color-parchment);
}

.marriage-photo-card:hover .marriage-photo {
  transform: scale(1.05);
}

.photo-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-2) var(--space-3);
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  color: white;
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0;
  transform: translateY(4px);
  transition: all var(--transition-base);
}

.marriage-photo-card:hover .photo-caption,
.marriage-photo-card:focus-visible .photo-caption,
.about-portrait-wrapper:hover .photo-caption,
.about-portrait-wrapper:focus-visible .photo-caption {
  opacity: 1;
  transform: translateY(0);
}

/* Portrait with hover caption */
.about-portrait-wrapper {
  position: relative;
  flex-shrink: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-base);
}

.about-portrait-wrapper:hover,
.about-portrait-wrapper:focus-visible {
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  z-index: 2;
}

.about-portrait-wrapper .photo-caption {
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Photo lightbox overlay (click to enlarge) */
.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.85);
  cursor: pointer;
  animation: fadeIn var(--transition-base) ease;
}

.photo-lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.photo-lightbox-caption {
  position: absolute;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  background: rgba(0,0,0,0.6);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
}

.about-askdoc-section {
  margin-bottom: var(--space-6);
}

.about-askdoc-section h3 {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  color: var(--color-text-dark);
  margin-bottom: var(--space-2);
}

.about-askdoc-section p {
  font-size: 0.875rem;
  color: var(--color-text-mid);
  line-height: 1.7;
}

.about-coming-soon {
  margin-bottom: var(--space-6);
}

.about-coming-soon h3 {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  color: var(--color-text-dark);
  margin-bottom: var(--space-4);
}

.coming-soon-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.coming-soon-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-parchment);
  align-items: flex-start;
}

.coming-soon-item svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.coming-soon-item strong {
  display: block;
  font-size: 0.8125rem;
  color: var(--color-text-dark);
  margin-bottom: 2px;
}

.coming-soon-item span {
  font-size: 0.75rem;
  color: var(--color-text-soft);
  line-height: 1.4;
}

@media (max-width: 600px) {
  .about-photo-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .about-family {
    flex-direction: column;
    text-align: center;
  }
  .coming-soon-grid {
    grid-template-columns: 1fr;
  }
}

/* Keyboard shortcuts modal */
.shortcut-grid {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) 0;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

.shortcut-row kbd {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  background: var(--color-cream);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-mid);
  min-width: 40px;
  text-align: center;
}

.shortcut-row span {
  font-size: 0.8125rem;
  color: var(--color-text-mid);
}


/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: var(--space-3) var(--space-5);
  background: var(--color-navy);
  color: var(--color-white);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn var(--transition-slow) ease;
}

.toast.toast-success { background: var(--color-success); }
.toast.toast-error { background: var(--color-error); }

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


/* ============================================================
   MOBILE TAB BAR
   ============================================================ */
.mobile-tab-bar {
  display: none;
}


/* ============================================================
   LOADING / SKELETON
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--color-parchment) 25%, var(--color-cream) 50%, var(--color-parchment) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-line {
  height: 14px;
  margin-bottom: var(--space-2);
}

.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }
.skeleton-line.full { width: 100%; }

/* Error bubble */
.error-bubble {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: 0.8125rem;
}


/* ============================================================
   KEYFRAME ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

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

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}


/* ============================================================
   SCRIPTURE QUOTE & VERSE REF
   ============================================================ */
/* Paragraph spacing in AI responses */
.ai-para {
  margin: 0 0 0.75em 0;
  line-height: 1.7;
}
.ai-para:last-child { margin-bottom: 0; }

/* Inline scripture quotes (short) */
.scripture-inline {
  font-style: italic;
  font-family: var(--font-scripture);
}

/* Block scripture quotes (long) */
.scripture-quote {
  background: var(--color-gold-pale);
  border-left: 3px solid var(--color-gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: var(--space-3) var(--space-4);
  margin: var(--space-3) 0;
  font-family: var(--font-scripture);
  font-style: italic;
  font-size: 0.9375rem;
  color: var(--color-text-dark);
  line-height: 1.7;
}

.verse-ref {
  color: var(--color-gold);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(201, 150, 59, 0.3);
  text-underline-offset: 2px;
  font-weight: 500;
  transition: all var(--transition-fast);
}
.verse-ref:hover {
  text-decoration-color: var(--color-gold);
}


/* ============================================================
   VERSE POPUP
   ============================================================ */
.verse-popup {
  position: fixed;
  z-index: 150;
  width: 340px;
  max-width: 90vw;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-4);
  animation: fadeSlideUp var(--transition-base) ease;
}
.verse-popup[hidden] { display: none; }
.verse-popup-ref {
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-gold);
  margin-bottom: var(--space-2);
}
.verse-popup-text {
  font-family: var(--font-scripture);
  font-style: italic;
  font-size: 0.875rem;
  color: var(--color-text-dark);
  line-height: 1.7;
  margin-bottom: var(--space-3);
}
.verse-popup-actions {
  display: flex;
  gap: var(--space-2);
}
.verse-popup-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-parchment);
  color: var(--color-text-mid);
  font-size: 0.75rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.verse-popup-btn:hover {
  background: var(--color-gold);
  color: white;
  border-color: var(--color-gold);
}
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}


/* ============================================================
   BIBLE READER PANEL
   ============================================================ */
.bible-reader {
  position: fixed;
  top: var(--header-height);
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 100vw;
  background: var(--color-cream);
  border-left: 1px solid var(--color-border);
  box-shadow: -4px 0 20px rgba(0,0,0,0.1);
  z-index: 60;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition-slow) cubic-bezier(0.4, 0, 0.2, 1);
}
.bible-reader[hidden] { display: none; }
.bible-reader.bible-reader-open {
  display: flex;
  transform: translateX(0);
}
.bible-reader-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-parchment);
  flex-shrink: 0;
}
.bible-reader-header h3 {
  flex: 1;
  text-align: center;
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--color-text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bible-nav-btn, .bible-reader-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-text-mid);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.bible-nav-btn:hover, .bible-reader-close:hover {
  border-color: var(--color-gold);
  color: var(--color-gold);
}
.bible-reader-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-6) var(--space-5);
  font-family: var(--font-scripture);
  font-size: 1rem;
  line-height: 1.9;
  color: var(--color-text-dark);
}
.bible-verse-line {
  margin-bottom: var(--space-2);
  position: relative;
}
.bible-verse-num {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-gold);
  vertical-align: super;
  margin-right: var(--space-1);
  cursor: pointer;
}
.bible-verse-actions {
  display: inline-flex;
  gap: 4px;
  margin-left: 4px;
  opacity: 0;
  transition: opacity var(--transition-fast);
}
.bible-verse-line:hover .bible-verse-actions {
  opacity: 1;
}
.bible-verse-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--color-text-soft);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.bible-verse-action-btn:hover {
  color: var(--color-gold);
  background: var(--color-gold-pale);
}
.bible-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--color-text-soft);
}
.bible-error {
  text-align: center;
  padding: var(--space-8);
  color: var(--color-text-soft);
}
/* Highlights */
.bible-highlight-yellow { background: rgba(255, 235, 59, 0.3); border-radius: 2px; padding: 1px 0; }
.bible-highlight-blue { background: rgba(100, 181, 246, 0.3); border-radius: 2px; padding: 1px 0; }
.bible-highlight-pink { background: rgba(240, 98, 146, 0.25); border-radius: 2px; padding: 1px 0; }


/* ============================================================
   MEMORY VERSES
   ============================================================ */
.memory-verses-list {
  padding: var(--space-3);
}
.memory-verse-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  margin-bottom: var(--space-2);
  transition: all var(--transition-fast);
}
.memory-verse-card:hover {
  border-color: var(--color-gold);
  box-shadow: var(--shadow-sm);
}
.memory-verse-ref {
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-gold);
  margin-bottom: var(--space-1);
}
.memory-verse-text {
  font-size: 0.8125rem;
  color: var(--color-text-mid);
  line-height: 1.5;
  margin-bottom: var(--space-2);
  font-style: italic;
}
.memory-verse-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}
.memory-verse-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-parchment);
  color: var(--color-text-mid);
  font-size: 0.6875rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.memory-verse-btn:hover {
  background: var(--color-gold);
  color: white;
  border-color: var(--color-gold);
}
.memory-verse-btn.practice-btn {
  border-color: var(--color-gold);
  color: var(--color-gold);
}
.memory-practice-input {
  width: 100%;
  padding: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  margin-top: var(--space-2);
  font-family: var(--font-body);
  background: var(--color-cream);
  color: var(--color-text-dark);
}
.memory-practice-result {
  margin-top: var(--space-2);
  font-size: 0.75rem;
  line-height: 1.5;
}
.memory-word-correct { color: var(--color-success); }
.memory-word-wrong { color: var(--color-error); text-decoration: line-through; }
.memory-word-missing { color: var(--color-error); font-style: italic; }
.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--color-gold);
  color: white;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0 4px;
}
.count-badge[hidden] { display: none; }


/* ============================================================
   SIDEBAR CARDS
   ============================================================ */
.sidebar-cards {
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-3);
}
.sidebar-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-parchment);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
  position: relative;
}
.sidebar-card:hover {
  border-color: var(--color-gold);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(201, 150, 59, 0.15);
}
.sidebar-card strong {
  display: block;
  font-size: 0.8125rem;
  color: var(--color-text-dark);
}
.sidebar-card span {
  font-size: 0.6875rem;
  color: var(--color-text-soft);
}
.sidebar-card .count-badge {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
}


/* ============================================================
   FAITH & FAMILY GAMES
   ============================================================ */
.games-coming-soon {
  padding: var(--space-4);
  text-align: center;
}

.games-hero-icon {
  margin-bottom: var(--space-3);
}

/* (games-cross-img removed — cross is now the chat watermark) */

.games-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--color-text-dark);
  margin-bottom: var(--space-2);
}

.games-coming-badge {
  display: inline-block;
  padding: 4px 16px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-gold), var(--color-gold-light));
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}

.games-description {
  font-size: 0.8125rem;
  color: var(--color-text-mid);
  line-height: 1.6;
  margin-bottom: var(--space-5);
}

.games-age-groups {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  text-align: left;
}

.games-age-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-white);
  transition: all var(--transition-fast);
}

.games-age-card:hover {
  border-color: var(--color-gold);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.games-age-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--color-gold-pale);
  flex-shrink: 0;
}

.games-age-info {
  flex: 1;
  min-width: 0;
}

.games-age-info strong {
  display: block;
  font-size: 0.8125rem;
  color: var(--color-text-dark);
  margin-bottom: 1px;
  line-height: 1.3;
}

.games-age-info span {
  display: block;
  font-size: 0.6875rem;
  color: var(--color-text-soft);
  line-height: 1.4;
}

.games-footer-note {
  font-size: 0.75rem;
  color: var(--color-text-soft);
  line-height: 1.6;
  font-style: italic;
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}

[data-theme="dark"] .games-age-card {
  background: #1E2D3D;
}

[data-theme="dark"] .games-age-card strong {
  color: #EDF2F7;
}

[data-theme="dark"] .games-age-icon {
  background: rgba(201, 150, 59, 0.15);
}

[data-theme="dark"] .games-title {
  color: var(--color-gold);
}


/* ============================================================
   RESPONSIVE — NARROW DESKTOP (<1200px) — shrink search
   ============================================================ */
@media (max-width: 1199px) {
  .header-center {
    flex: 0 1 200px;
  }
  .header-search-kbd { display: none; }
}

/* ============================================================
   RESPONSIVE — TABLET (<1024px)
   ============================================================ */
@media (max-width: 1023px) {
  .header-center {
    display: none;
  }

  .health-text {
    display: none;
  }

  .app-layout {
    grid-template-columns: 1fr;
  }

  #sidebar-toggle {
    display: flex;
  }

  #sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    z-index: 40;
    width: 300px;
    transform: translateX(-100%);
    transition: transform var(--transition-slow);
    box-shadow: var(--shadow-lg);
  }

  #sidebar.open {
    transform: translateX(0);
  }

  #sidebar-overlay {
    position: fixed;
    inset: 0;
    top: var(--header-height);
    background: rgba(0,0,0,0.4);
    z-index: 35;
    display: none;
  }

  #sidebar-overlay.open {
    display: block;
    animation: fadeIn var(--transition-base) ease;
  }
}


/* ============================================================
   RESPONSIVE — MOBILE (<768px)
   ============================================================ */
@media (max-width: 767px) {
  :root {
    --header-height: 52px;
    --mobile-tab-height: 52px;
  }

  #app-header {
    height: var(--header-height);
    padding: 0 var(--space-3);
  }

  .header-tagline {
    display: none;
  }

  .header-title {
    font-size: 18px;
  }

  .header-cross-icon {
    width: 22px;
    height: 22px;
  }

  .header-logo-img {
    height: 32px;
  }

  #theme-toggle {
    display: none;
  }

  /* Mobile: compact board */
  .saved-counter { gap: 4px; }
  .saved-ticker-label { display: none; }
  .saved-ticker-suffix { display: none; }
  .flip-unit { width: 14px; height: 20px; }
  .flip-top, .flip-bottom, .flip-card-top, .flip-card-bottom {
    font-size: 0.75rem !important;
  }
  .flip-top, .flip-card-top { line-height: 20px !important; }
  .saved-ticker { padding: 2px 3px; }

  .header-right {
    gap: var(--space-2) !important;
  }

  .app-layout {
    height: calc(100vh - var(--header-height) - var(--mobile-tab-height));
  }

  #sidebar {
    top: var(--header-height);
    bottom: var(--mobile-tab-height);
    width: 100%;
    transform: translateY(100%);
    left: 0;
  }

  #sidebar.open {
    transform: translateY(0);
  }

  #sidebar-overlay {
    top: var(--header-height);
    bottom: var(--mobile-tab-height);
  }

  .right-panel {
    width: 100%;
    top: var(--header-height);
    bottom: var(--mobile-tab-height);
  }

  .chat-area {
    padding: var(--space-4) var(--space-3) var(--space-3);
  }

  .input-bar {
    padding: var(--space-3);
  }

  .bubble-user {
    max-width: 85%;
  }

  .bubble-bot {
    max-width: 90%;
  }

  .welcome-heading {
    font-size: 24px;
  }

  .welcome-subheading {
    font-size: 0.875rem;
  }

  .daily-verse {
    margin-bottom: var(--space-5);
  }

  /* Mobile tab bar */
  .mobile-tab-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--mobile-tab-height);
    background: var(--color-navy);
    z-index: 50;
    border-top: 1px solid rgba(255,255,255,0.1);
  }

  .mobile-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: rgba(255,255,255,0.5);
    font-size: 0.625rem;
    font-weight: 500;
    transition: color var(--transition-fast);
    padding: var(--space-1) 0;
  }

  .mobile-tab.active {
    color: var(--color-gold);
  }

  .mobile-tab svg {
    width: 20px;
    height: 20px;
  }

  .scroll-to-bottom {
    bottom: calc(var(--mobile-tab-height) + 100px);
  }

  .bible-reader {
    width: 100vw;
    top: 0;
    z-index: 100;
  }

  .follow-up-btn {
    width: 100%;
    font-size: 14px;
    padding: 12px 16px;
  }

  .action-btn {
    min-width: 44px;
    min-height: 44px;
  }

  .source-pills {
    max-width: 100%;
    flex-wrap: wrap;
  }

  .input-bar {
    padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom, 0px));
  }

  .copy-btn {
    opacity: 1 !important;
  }

  .bible-verse-actions {
    opacity: 1;
  }

  /* Modal adjustments */
  .modal-content {
    max-height: 85vh;
    margin: 0 var(--space-1);
    width: calc(100% - var(--space-2));
  }

  .modal-body {
    padding: var(--space-8) var(--space-5);
  }

  .about-hero-img {
    object-position: center 0%;
    height: 180px;
  }

  .modal-stats {
    gap: var(--space-4);
  }

  .modal-stat-number {
    font-size: 1.25rem;
  }
}


/* ============================================================
   SETTINGS MODAL
   ============================================================ */
.settings-layout {
  display: flex;
  min-height: 480px;
  max-height: 80vh;
}

.settings-nav {
  display: flex;
  flex-direction: column;
  width: 180px;
  min-width: 180px;
  padding: var(--space-5) 0;
  border-right: 1px solid var(--color-border);
  background: var(--color-parchment);
  border-radius: var(--radius-xl) 0 0 var(--radius-xl);
}

.settings-nav-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: var(--space-3) var(--space-5);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-mid);
  border: none;
  background: none;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all var(--transition-fast);
}

.settings-nav-btn:hover {
  color: var(--color-text-dark);
  background: rgba(0, 0, 0, 0.03);
}

.settings-nav-btn.active {
  color: var(--color-gold);
  font-weight: 600;
  border-left-color: var(--color-gold);
  background: rgba(201, 150, 59, 0.08);
}

.settings-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-8);
  min-width: 0;
}

.settings-content::-webkit-scrollbar { width: 5px; }
.settings-content::-webkit-scrollbar-track { background: transparent; }
.settings-content::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 3px; }

.settings-section {
  display: none;
}

.settings-section.active {
  display: block;
}

.settings-section h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-dark);
  margin-bottom: var(--space-6);
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border);
}

.setting-row:last-child {
  border-bottom: none;
}

.setting-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

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

.setting-desc {
  font-size: 0.75rem;
  color: var(--color-text-soft);
  line-height: 1.4;
}

/* Toggle switch (iOS-style) */
.setting-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

.setting-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--color-border);
  border-radius: var(--radius-full);
  transition: background var(--transition-base);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: var(--color-white);
  border-radius: 50%;
  transition: transform var(--transition-base);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.setting-toggle input:checked + .toggle-slider {
  background: var(--color-gold);
}

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

.setting-toggle input:disabled + .toggle-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

.setting-toggle input:disabled ~ .toggle-slider {
  opacity: 0.5;
}

/* Select dropdown */
.setting-select {
  padding: var(--space-2) var(--space-3);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-cream);
  color: var(--color-text-dark);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  min-width: 160px;
  cursor: pointer;
  transition: border-color var(--transition-fast);
  flex-shrink: 0;
}

.setting-select:focus {
  outline: none;
  border-color: var(--color-gold);
}

.setting-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Text input */
.setting-input {
  padding: var(--space-2) var(--space-3);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-cream);
  color: var(--color-text-dark);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  width: 160px;
  flex-shrink: 0;
}

.setting-input:focus {
  outline: none;
  border-color: var(--color-gold);
}

.setting-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Action buttons */
.setting-action-btn {
  padding: var(--space-2) var(--space-4);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-cream);
  color: var(--color-text-dark);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.setting-action-btn:hover:not(:disabled) {
  border-color: var(--color-gold);
  color: var(--color-gold);
}

.setting-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.setting-danger-btn {
  border-color: rgba(197, 48, 48, 0.3);
  color: var(--color-error);
}

.setting-danger-btn:hover:not(:disabled) {
  border-color: var(--color-error);
  background: rgba(197, 48, 48, 0.06);
  color: var(--color-error);
}

/* Coming soon banner */
.setting-coming-soon {
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-5);
  background: rgba(201, 150, 59, 0.1);
  border: 1px solid rgba(201, 150, 59, 0.3);
  border-radius: var(--radius-md);
  color: var(--color-gold);
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: center;
}

/* Version footer */
.settings-version {
  margin-top: var(--space-8);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border);
  text-align: center;
  font-size: 0.6875rem;
  color: var(--color-text-soft);
  line-height: 1.6;
}

/* ---- Settings dark mode ---- */
[data-theme="dark"] .settings-nav {
  background: #0F1923;
  border-right-color: var(--color-border);
}

[data-theme="dark"] .settings-nav-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #EDF2F7;
}

[data-theme="dark"] .settings-nav-btn.active {
  background: rgba(201, 150, 59, 0.12);
}

[data-theme="dark"] .settings-section h3 {
  color: var(--color-gold);
}

[data-theme="dark"] .setting-label {
  color: #EDF2F7;
}

[data-theme="dark"] .setting-select,
[data-theme="dark"] .setting-input {
  background: #0F1923;
  border-color: var(--color-border);
  color: #EDF2F7;
}

[data-theme="dark"] .setting-action-btn {
  background: #0F1923;
  border-color: var(--color-border);
  color: #EDF2F7;
}

[data-theme="dark"] .setting-danger-btn {
  color: #FC8181;
  border-color: rgba(252, 129, 129, 0.3);
}

[data-theme="dark"] .setting-coming-soon {
  background: rgba(201, 150, 59, 0.08);
  border-color: rgba(201, 150, 59, 0.25);
}

[data-theme="dark"] .toggle-slider {
  background: #2A3A52;
}

[data-theme="dark"] .toggle-slider::before {
  background: #1A2535;
}

[data-theme="dark"] .setting-toggle input:checked + .toggle-slider::before {
  background: #0F1923;
}

/* ---- Settings responsive ---- */
@media (max-width: 600px) {
  .settings-layout {
    flex-direction: column;
    min-height: auto;
  }

  .settings-nav {
    flex-direction: row;
    width: 100%;
    min-width: auto;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: var(--space-2) 0;
  }

  .settings-nav-btn {
    white-space: nowrap;
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: var(--space-2) var(--space-3);
    font-size: 0.75rem;
    text-align: center;
  }

  .settings-nav-btn.active {
    border-left-color: transparent;
    border-bottom-color: var(--color-gold);
  }

  .settings-content {
    padding: var(--space-5);
  }

  .setting-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }

  .setting-select,
  .setting-input {
    width: 100%;
    min-width: auto;
  }
}


/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  #app-header,
  #sidebar,
  #sidebar-overlay,
  .right-panel,
  #typing-indicator,
  .input-bar,
  .mobile-tab-bar,
  .scroll-to-bottom,
  #health-dot,
  #health-text,
  .msg-copy-btn,
  .msg-feedback,
  .toast-container {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .app-layout {
    display: block;
    height: auto;
    overflow: visible;
  }

  .chat-area {
    overflow: visible;
    height: auto;
  }

  .chat-message {
    animation: none !important;
    break-inside: avoid;
  }

  .bubble-user {
    background: #eee;
    color: #000;
    border: 1px solid #ccc;
  }

  .bubble-bot {
    border: 1px solid #ccc;
  }
}

/* ============================================================
   Sermon Viewer Modal
   ============================================================ */
.sermon-viewer {
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}

.sermon-viewer-header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-5);
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.sermon-viewer-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-gold);
    flex-shrink: 0;
}

.sermon-viewer-meta h2 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--color-gold);
    margin-bottom: 2px;
}

.sermon-viewer-meta p {
    font-size: 0.75rem;
    color: var(--color-text-soft);
    margin: 0;
}

.sermon-viewer-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-5);
}

.sermon-transcript {
    font-family: var(--font-body);
    font-size: 0.85rem;
    line-height: 1.8;
    color: var(--color-text-dark);
}

.sermon-para {
    margin-bottom: var(--space-4);
}

.sermon-para-highlighted {
    background: var(--color-gold-pale);
    border-left: 4px solid var(--color-gold);
    padding: var(--space-3) var(--space-4);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    scroll-margin-top: 100px;
}

[data-theme="dark"] .sermon-para-highlighted {
    background: rgba(201, 150, 59, 0.1);
}

/* ============================================================
   BOOKMARK BUTTON & DROPDOWN
   ============================================================ */
.header-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.7);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.header-btn:hover {
  background: rgba(255,255,255,0.1);
  color: var(--color-white);
}

/* No count badge on bookmark icon */
.bookmark-count { display: none !important; }

.bookmarks-dropdown {
  position: fixed;
  top: var(--header-height);
  right: 20px;
  width: 320px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  padding: var(--space-3);
}

[data-theme="dark"] .bookmarks-dropdown { background: #1E2D3D; }

.bookmarks-dropdown-empty {
  text-align: center;
  padding: var(--space-5);
  color: var(--color-text-soft);
  font-size: 0.8rem;
}

.bookmark-item {
  padding: var(--space-3);
  border-bottom: 1px solid var(--color-border);
  font-size: 0.75rem;
}

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

.bookmark-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bookmark-item-title { color: var(--color-gold); font-weight: 700; font-size: 0.8rem; }

.bookmark-item-text {
  font-style: italic;
  color: var(--color-text-mid);
  margin-top: 4px;
  line-height: 1.4;
}

.bookmark-item-remove {
  color: var(--color-text-soft);
  cursor: pointer;
  background: none;
  border: none;
  padding: 2px;
  font-size: 0.7rem;
  transition: color var(--transition-fast);
}

.bookmark-item-remove:hover { color: var(--color-error); }

/* ============================================================
   GOSPEL FRAMEWORK CTA HOOKS
   ============================================================ */
.gospel-cta {
  margin-top: var(--space-3);
  text-align: center;
}

/* Legacy gospel-cta-btn removed — replaced by .gospel-stage-btn */

/* ============================================================
   PROFILE SETUP (Settings)
   ============================================================ */
.setting-profile-row {
  justify-content: center !important;
  padding: var(--space-4) 0;
}

.profile-avatar-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.profile-avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--color-bg-subtle);
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
}

.profile-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar-edit-btn {
  font-size: 0.7rem;
  color: var(--color-gold);
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-body);
}

.profile-avatar-edit-btn:hover {
  text-decoration: underline;
}

.salvation-date-label {
  color: var(--color-gold) !important;
  font-weight: 700 !important;
  font-size: 0.9rem !important;
}

#salvation-date-value {
  color: var(--color-gold) !important;
  font-weight: 600;
  font-size: 0.8rem !important;
}

/* ============================================================
   SAVED COUNTER + BAPTISM BUTTON (Header)
   ============================================================ */
/* ── Saved badge: "I'm Saved" + split-flap counter ── */
.saved-counter {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  flex-shrink: 0;
}


/* ── Solari split-flap board ── */
.saved-ticker {
  display: inline-flex;
  align-items: stretch;
  background: #0f1a2a;
  border: 2px solid rgba(201, 150, 59, 0.3);
  border-radius: 4px;
  padding: 4px 5px;
  gap: 0;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.7), 0 2px 6px rgba(0,0,0,0.5);
  flex-shrink: 0;
}

.saved-ticker-num {
  display: inline-flex;
  gap: 3px;
}

/* Separator between SOULS and number */
.flip-separator {
  width: 4px;
  flex-shrink: 0;
}

/* Letter flaps (BORN-AGAIN) — gold text on dark navy */
.flip-unit.letter .flip-top,
.flip-unit.letter .flip-bottom,
.flip-unit.letter .flip-card-top,
.flip-unit.letter .flip-card-bottom {
  color: var(--color-gold);
}

/* Number flaps — bright white on dark navy */
.flip-unit:not(.letter) .flip-top,
.flip-unit:not(.letter) .flip-bottom,
.flip-unit:not(.letter) .flip-card-top,
.flip-unit:not(.letter) .flip-card-bottom {
  color: #ffffff;
}

/* Each flap slot — FIXED size, never scales */
.flip-unit {
  position: relative;
  width: 20px;
  height: 28px;
  perspective: 120px;
  flex-shrink: 0;
}

/* Shared flap styles */
.flip-top, .flip-bottom,
.flip-card-top, .flip-card-bottom {
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
  overflow: hidden;
  background: #132238;
  color: #e8e8d0;
  font-family: 'Courier New', monospace;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  box-sizing: border-box;
}

.flip-top, .flip-card-top {
  top: 0;
  border-radius: 2px 2px 0 0;
  line-height: 28px;
  background: linear-gradient(180deg, #1a2d48 0%, #132238 100%);
}

.flip-bottom, .flip-card-bottom {
  bottom: 0;
  border-radius: 0 0 2px 2px;
  line-height: 0px;
  background: linear-gradient(180deg, #132238 0%, #0f1c30 100%);
}

/* Hinge line */
.flip-unit::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: #0a1420;
  z-index: 5;
}

/* Flipping cards */
.flip-card-top {
  z-index: 10;
  transform-origin: bottom center;
  backface-visibility: hidden;
}
.flip-card-top.flipping {
  animation: flapDown 0.15s ease-in forwards;
}

.flip-card-bottom {
  z-index: 10;
  transform-origin: top center;
  transform: rotateX(90deg);
  backface-visibility: hidden;
}
.flip-card-bottom.flipping {
  animation: flapUp 0.15s 0.08s ease-out forwards;
}

@keyframes flapDown {
  0%   { transform: rotateX(0deg); }
  100% { transform: rotateX(-90deg); }
}
@keyframes flapUp {
  0%   { transform: rotateX(90deg); }
  100% { transform: rotateX(0deg); }
}

.saved-ticker-label { display: none; }

/* Born Again tag */
.born-again-tag {
  font-family: var(--font-body);
  font-size: 0.55rem;
  font-weight: 800;
  color: #FFD700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 2px 8px;
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

/* User avatar in header */
.user-avatar-header {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.2);
}

.user-avatar-header img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* About Doc button in sidebar */
.sidebar-about-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px 10px;
  margin-top: 4px;
  background: none;
  border: none;
  color: var(--color-text-mid);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.sidebar-about-btn:hover {
  background: var(--color-bg-subtle);
}

.sidebar-about-img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--color-gold);
}

.saved-ticker-suffix {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  color: #FFD700;
  white-space: nowrap;
  margin-left: -2px;
}

/* ── Ticker pop-off feed (telecast award style) ── */
.saved-ticker-feed {
  position: fixed;
  top: var(--header-height);
  right: 16px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.saved-ticker-pop {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 6px;
  background: linear-gradient(135deg, rgba(47, 133, 90, 0.95), rgba(72, 187, 120, 0.95));
  border-radius: var(--radius-full);
  color: white;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  animation: tickerPopIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
             tickerPopOut 0.5s ease 3s forwards;
  box-shadow: 0 4px 16px rgba(47, 133, 90, 0.4);
}

.saved-ticker-pop-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  overflow: hidden;
  flex-shrink: 0;
}

.saved-ticker-pop-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.saved-ticker-pop-cross {
  margin-left: auto;
  opacity: 0.5;
}

@keyframes tickerPopIn {
  0% { transform: translateX(100px) scale(0.5); opacity: 0; }
  100% { transform: translateX(0) scale(1); opacity: 1; }
}

@keyframes tickerPopOut {
  0% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(100px); opacity: 0; }
}

/* Green B badge on hamburger menu */
.baptism-badge {
  position: absolute;
  top: 2px;
  right: 0px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #48BB78;
  color: white;
  font-size: 9px;
  font-weight: 800;
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  animation: baptismBadgePulse 2s ease infinite;
}

@keyframes baptismBadgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(72, 187, 120, 0.5); }
  50% { box-shadow: 0 0 0 4px rgba(72, 187, 120, 0); }
}

#sidebar-toggle {
  position: relative;
}

/* Baptism option inside sidebar */
.sidebar-baptism {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--color-border);
  margin-top: auto;
}

.baptism-sidebar-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  background: linear-gradient(135deg, #2F855A, #48BB78);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  animation: baptismSidebarPulse 2.5s ease infinite;
  transition: transform 0.2s;
}

.baptism-sidebar-btn:hover {
  transform: scale(1.02);
}

@keyframes baptismSidebarPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(47, 133, 90, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(47, 133, 90, 0); }
}

/* ============================================================
   SALVATION PRAYER CONFIRMATION
   ============================================================ */
.gospel-prayer-confirm {
  margin-top: var(--space-3);
  text-align: center;
}

.gospel-prayer-question {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-gold);
  margin-bottom: 10px;
}

.gospel-prayer-btns {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.gospel-prayer-yes,
.gospel-prayer-no {
  padding: 8px 24px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  border: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.gospel-prayer-yes {
  background: linear-gradient(135deg, #2F855A, #48BB78);
  color: white;
  animation: prayerYesPulse 2s ease infinite;
}

.gospel-prayer-yes:hover {
  transform: scale(1.08);
}

@keyframes prayerYesPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(47, 133, 90, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(47, 133, 90, 0); }
}

.gospel-prayer-no {
  background: transparent;
  color: var(--color-text-soft);
  border: 1px solid var(--color-border);
}

.gospel-prayer-no:hover {
  background: var(--color-bg-subtle);
}

/* ============================================================
   SALVATION CELEBRATION OVERLAY
   ============================================================ */
.salvation-celebration {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  animation: celebrationFadeIn 0.5s ease;
}

@keyframes celebrationFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.salvation-celebration-inner {
  text-align: center;
  position: relative;
}

.salvation-banner {
  font-family: var(--font-heading);
  font-size: 5rem;
  font-weight: 700;
  color: white;
  text-shadow: 0 0 40px rgba(47, 133, 90, 0.8), 0 0 80px rgba(47, 133, 90, 0.4);
  animation: savedBannerPulse 2s ease infinite;
}

@keyframes savedBannerPulse {
  0%, 100% {
    transform: scale(1);
    text-shadow: 0 0 40px rgba(47, 133, 90, 0.8), 0 0 80px rgba(47, 133, 90, 0.4);
  }
  50% {
    transform: scale(1.05);
    text-shadow: 0 0 60px rgba(47, 133, 90, 1), 0 0 120px rgba(47, 133, 90, 0.6);
  }
}

.salvation-subtitle {
  font-family: var(--font-body);
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 12px;
}

/* Confetti particles */
.confetti-piece {
  position: fixed;
  width: 10px;
  height: 10px;
  top: -10px;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ============================================================
   AVATAR CROP MODAL
   ============================================================ */
.avatar-crop-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-crop-container {
  background: #1E2D3D;
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  max-width: 320px;
  width: 90%;
}

.avatar-crop-title {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-white);
  margin-bottom: var(--space-4);
}

.avatar-crop-viewport {
  position: relative;
  width: 240px;
  height: 240px;
  margin: 0 auto;
  border-radius: 50%;
  overflow: hidden;
  cursor: grab;
  border: 3px solid var(--color-gold);
  box-shadow: 0 0 0 4px rgba(0,0,0,0.3);
}

.avatar-crop-viewport:active {
  cursor: grabbing;
}

.avatar-crop-canvas {
  width: 240px;
  height: 240px;
  display: block;
}

.avatar-crop-circle {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
}

.avatar-crop-zoom {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  margin-top: var(--space-4);
  color: var(--color-white);
}

.avatar-crop-slider {
  width: 160px;
  accent-color: var(--color-gold);
}

.avatar-crop-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: var(--space-5);
}

.avatar-crop-cancel,
.avatar-crop-save {
  padding: 8px 24px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  border: none;
  transition: transform 0.2s;
}

.avatar-crop-cancel {
  background: transparent;
  color: var(--color-text-soft);
  border: 1px solid var(--color-border);
}

.avatar-crop-cancel:hover {
  background: rgba(255,255,255,0.05);
}

.avatar-crop-save {
  background: linear-gradient(135deg, var(--color-gold), var(--color-gold-light));
  color: white;
}

.avatar-crop-save:hover {
  transform: scale(1.05);
}

/* Fix tooltips in header — show BELOW, anchored right */
.header-right [data-tooltip]:hover::after {
  bottom: auto;
  top: 100%;
  margin-bottom: 0;
  margin-top: 8px;
  right: 0;
  left: auto;
  transform: none;
  z-index: 9999;
}
