/* ============================================================
   Theology AI — Premium Catholic AI Interface
   A ministry of AD IPSUM, a 501(c)(3) public charity.
   Modernized 2026 — refined dark theme, frontier-AI polish,
   conversation search, dictation, donation, and PWA support.
   ============================================================ */

:root {
  /* ---- Monastery-inspired palette (refined) ---- */
  --bg-primary: #0A0E1A;
  --bg-secondary: #0D1320;
  --bg-elevated: #141B2A;
  --bg-raised: #1A2233;
  --bg-glass: rgba(13, 19, 32, 0.72);
  --bg-glass-strong: rgba(10, 14, 26, 0.86);

  /* ---- Sacred colors ---- */
  --monastery-gold: #E6C547;
  --sacred-purple: #7B3FA8;
  --stained-glass-blue: #5B7FED;
  --monastery-brown: #9B5523;
  --sacred-red: #E82A4A;
  --holy-white: #FFFEF7;

  /* ---- UI text & borders ---- */
  --text-primary: #ECEEF4;
  --text-secondary: #A3ABBF;
  --text-muted: #707A90;
  --border: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(255, 255, 255, 0.14);
  --border-strong: rgba(255, 255, 255, 0.18);

  /* ---- Accent (gold) — glow toned down for a calmer, modern feel ---- */
  --accent: var(--monastery-gold);
  --accent-hover: #F0D15F;
  --accent-soft: rgba(230, 197, 71, 0.12);
  --accent-glow: rgba(230, 197, 71, 0.18);
  --link-gold: #FFD75E;
  --link-gold-hover: #FFE8A3;

  /* ---- Status ---- */
  --success: #34D399;
  --danger: #F43F5E;
  --warning: #FBBF24;
  --recording: #EF4444;

  /* ---- Shadows ---- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.30);
  --shadow: 0 4px 14px -4px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 32px -8px rgba(0, 0, 0, 0.55);
  --shadow-xl: 0 24px 60px -12px rgba(0, 0, 0, 0.65);

  /* ---- Radius ---- */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  /* ---- Motion ---- */
  --transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* ---- Layout ---- */
  --sidebar-width: 288px;
  --header-height: 60px;
  --content-max: 52rem;

  /* ---- Type ---- */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;

  /* Dynamic app height: filled in by JS (--app-vh) with a dvh fallback. */
  --app-height: 100dvh;
}

/* ===== Reset & Base ===== */

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

html {
  height: 100%;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow: hidden;
  position: relative;
  /* Prevent the iOS rubber-band from revealing the page behind the app shell */
  overscroll-behavior: none;
}

/* Ambient background — calmer, less saturated than before */
.ambient-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 18% 22%, rgba(123, 63, 168, 0.07) 0%, transparent 46%),
    radial-gradient(circle at 84% 76%, rgba(230, 197, 71, 0.045) 0%, transparent 48%),
    radial-gradient(circle at 50% 50%, rgba(91, 127, 237, 0.03) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

/* ===== App Shell Layout =====
   Uses a JS-measured --app-height for rock-solid sizing on mobile,
   with a 100dvh fallback for browsers without the JS hook. */

.app-container {
  position: relative;
  display: flex;
  height: 100vh;            /* fallback */
  height: var(--app-height);
  z-index: 1;
}

/* ===== Sidebar ===== */

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  padding: 1.15rem 1.25rem;
  padding-top: max(1.15rem, env(safe-area-inset-top));
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.brand-icon {
  font-size: 1.7rem;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(230, 197, 71, 0.28));
}

.brand-icon-img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(230, 197, 71, 0.22);
}

.brand-text { min-width: 0; }

.brand-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.brand-subtitle {
  font-size: 0.68rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 0.05rem;
}

/* Close button for the mobile sidebar drawer */
.sidebar-close {
  display: none;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.sidebar-close:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.sidebar-actions {
  padding: 0.9rem 1rem 0.6rem;
}

.btn-new-chat {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.7rem 1rem;
  background: linear-gradient(135deg, var(--monastery-gold) 0%, var(--accent-hover) 100%);
  color: #1A1407;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

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

.btn-new-chat:active { transform: translateY(0); }

.sidebar-journey-link {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.65rem;
  padding: 0.68rem 0.72rem;
  overflow: hidden;
  border: 1px solid rgba(230, 197, 71, 0.22);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(58, 48, 101, 0.38), rgba(20, 22, 35, 0.7));
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
}
.sidebar-journey-link::after {
  content: "";
  position: absolute;
  top: -44px;
  right: -28px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(230, 197, 71, 0.13), transparent 68%);
  pointer-events: none;
}
.sidebar-journey-link:hover {
  transform: translateY(-1px);
  border-color: rgba(230, 197, 71, 0.42);
  background: linear-gradient(135deg, rgba(69, 57, 118, 0.5), rgba(23, 25, 39, 0.82));
  box-shadow: 0 8px 24px rgba(0,0,0,.18), 0 0 18px rgba(230,197,71,.045);
}
.sidebar-journey-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(230, 197, 71, 0.3);
  border-radius: 50%;
  color: var(--accent);
  font-size: 0.7rem;
  text-shadow: 0 0 9px rgba(230,197,71,.65);
}
.sidebar-journey-copy { min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.sidebar-journey-copy strong { color: #f3e5b7; font-family: var(--font-serif); font-size: 0.94rem; font-weight: 600; line-height: 1.1; }
.sidebar-journey-copy small { overflow: hidden; color: var(--text-muted); font-size: 0.62rem; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-journey-arrow { position: relative; z-index: 1; color: var(--accent); font-size: 0.9rem; }

/* ---- Sidebar search (Feature 1) ---- */
.sidebar-search {
  padding: 0.35rem 1rem 0.65rem;
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
}

.search-field .search-icon {
  position: absolute;
  left: 0.7rem;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.6rem 2.2rem 0.6rem 2.1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  transition: var(--transition);
}

.search-input::placeholder { color: var(--text-muted); }

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-kbd {
  position: absolute;
  right: 0.55rem;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.1rem 0.35rem;
  pointer-events: none;
}

.search-clear {
  position: absolute;
  right: 0.45rem;
  width: 22px;
  height: 22px;
  display: none;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--bg-raised);
  color: var(--text-secondary);
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
}

.search-clear:hover { color: var(--text-primary); background: var(--border-hover); }

.sidebar-section {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.section-label {
  padding: 0.6rem 1rem 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.thread-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 0.5rem 0.5rem;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.thread-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.7rem;
  margin-bottom: 0.2rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.thread-item:hover {
  background: var(--bg-elevated);
}

.thread-item.active {
  background: var(--bg-elevated);
  border-color: var(--border-hover);
}

.thread-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 18%; bottom: 18%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

.thread-icon { font-size: 1rem; opacity: 0.7; flex-shrink: 0; }
.thread-content { flex: 1; min-width: 0; }

.thread-title {
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  word-break: normal;
  text-overflow: clip;
  line-height: 1.35;
}

.thread-snippet {
  font-size: 0.74rem;
  color: var(--text-secondary);
  margin-top: 0.12rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-snippet mark {
  background: var(--accent-soft);
  color: var(--accent-hover);
  border-radius: 3px;
  padding: 0 0.1em;
}

.thread-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.thread-actions {
  display: flex;
  gap: 0.2rem;
  opacity: 0;
  transition: var(--transition);
}

.thread-item:hover .thread-actions,
.thread-item:focus-within .thread-actions { opacity: 1; }

.thread-action-btn {
  width: 1.7rem;
  height: 1.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.thread-action-btn:hover { background: var(--bg-raised); color: var(--text-primary); }

/* Search empty state */
.search-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted);
}
.search-empty .se-icon { font-size: 1.6rem; opacity: 0.55; margin-bottom: 0.5rem; }
.search-empty .se-text { font-size: 0.85rem; }

/* ===== Sidebar footer ===== */
.sidebar-footer {
  padding: 0.8rem 1rem;
  padding-bottom: max(0.8rem, calc(0.4rem + env(safe-area-inset-bottom)));
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-footer-row {
  display: flex;
  gap: 0.5rem;
}

.sidebar-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.sidebar-btn:hover { background: var(--bg-raised); border-color: var(--border-hover); color: var(--text-primary); }

/* Support / donate button gets a gentle gold tint */
.sidebar-btn.support-btn { color: var(--accent); border-color: rgba(230, 197, 71, 0.25); }
.sidebar-btn.support-btn:hover { background: var(--accent-soft); border-color: rgba(230, 197, 71, 0.45); color: var(--accent-hover); }

.org-link {
  display: block;
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}
.org-link strong { color: var(--text-secondary); }
.org-link:hover { color: var(--text-secondary); }

/* ===== Main Chat Area ===== */

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.chat-header {
  height: var(--header-height);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  padding-top: env(safe-area-inset-top);
  height: calc(var(--header-height) + env(safe-area-inset-top));
  background: var(--bg-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

.chat-title {
  font-family: var(--font-serif);
  font-size: 1.18rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-status {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

.status-dot.streaming { background: var(--warning); box-shadow: 0 0 8px var(--warning); }
.status-dot.error { background: var(--danger); box-shadow: 0 0 8px var(--danger); animation: none; }

/* ===== Messages ===== */

.messages-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.messages-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 1.75rem 1.5rem;
}

/* ---- Empty state ---- */
.empty-state {
  text-align: center;
  padding: 2.5rem 1.5rem 1.5rem;
  animation: fadeIn 0.4s ease-out;
  /* Safety guard: if any script ever sets display:flex on this container,
     children still stack vertically instead of jumbling into a row. */
  flex-direction: column;
}

.empty-icon { margin-bottom: 1.25rem; }

.liturgical-today {
  max-width: 34rem;
  margin: 0 auto 1.1rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(230, 197, 71, 0.22);
  border-bottom: 1px solid rgba(230, 197, 71, 0.10);
  background: linear-gradient(180deg, rgba(230, 197, 71, 0.045), rgba(230, 197, 71, 0.015));
  border-radius: var(--radius);
  box-shadow: 0 0 24px rgba(230, 197, 71, 0.035);
}

.lt-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.lt-title {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  line-height: 1.35;
  color: var(--text-primary);
}

.lt-meta {
  margin-top: 0.22rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.empty-icon img {
  width: 300px;
  height: 300px;
  max-width: 62vw;
  max-height: 62vw;
  border-radius: 22px;
  object-fit: cover;
  /* Soft golden-gold glow around the monk image (brand focal point) */
  border: 1px solid rgba(230, 197, 71, 0.35);
  box-shadow:
    0 18px 50px -12px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(230, 197, 71, 0.25),
    0 0 28px 2px rgba(230, 197, 71, 0.30),
    0 0 60px 8px rgba(230, 197, 71, 0.18);
}

/* ============================================================
   SANCTUARY HERO — shimmering "Theology AI" welcome
   Replaces the static monk image as the empty-state focal point.
   Pure CSS: rotating monstrance rays, breathing halo, traveling
   gold shimmer across the letters, and rising incense motes.
   ============================================================ */
.hero-welcome {
  position: relative;
  isolation: isolate;
  max-width: 46rem;
  margin: 0.4rem auto 1.4rem;
  padding: 2.4rem 1rem 0.6rem;
}

/* Monstrance sunburst — fine gold rays rotating slowly behind the title */
.hero-rays {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(640px, 115vw);
  aspect-ratio: 1;
  transform: translate(-50%, -56%);
  background: repeating-conic-gradient(
    from 0deg at 50% 50%,
    rgba(230, 197, 71, 0.15) 0deg 1.6deg,
    transparent 1.6deg 10deg
  );
  -webkit-mask-image: radial-gradient(closest-side, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.35) 45%, transparent 68%);
          mask-image: radial-gradient(closest-side, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.35) 45%, transparent 68%);
  animation: heroRaysSpin 120s linear infinite;
  z-index: -2;
  pointer-events: none;
}
@keyframes heroRaysSpin {
  to { transform: translate(-50%, -56%) rotate(360deg); }
}

/* Breathing halo glow behind the wordmark */
.hero-halo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(500px, 82vw);
  aspect-ratio: 1.55;
  transform: translate(-50%, -58%);
  background: radial-gradient(50% 50% at 50% 50%,
    rgba(230, 197, 71, 0.20) 0%,
    rgba(230, 197, 71, 0.07) 42%,
    transparent 70%);
  filter: blur(6px);
  animation: heroHalo 5.5s ease-in-out infinite;
  z-index: -1;
  pointer-events: none;
}
@keyframes heroHalo {
  0%, 100% { opacity: 0.75; transform: translate(-50%, -58%) scale(1); }
  50%      { opacity: 1;    transform: translate(-50%, -58%) scale(1.07); }
}

/* "WELCOME TO" eyebrow */
.hero-eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.42em;
  text-indent: 0.42em; /* optically recenters letter-spaced text */
  text-transform: uppercase;
  color: var(--text-secondary);
  animation: heroFadeUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.1s both;
}
.hero-eyebrow .he-orn {
  color: var(--accent);
  font-size: 0.62rem;
  letter-spacing: 0;
  text-indent: 0;
  text-shadow: 0 0 8px rgba(230, 197, 71, 0.55);
}

/* The wordmark — liquid-gold letters with a traveling shimmer.
   Each letter runs the same sweep with a staggered delay, so the
   highlight visibly passes across the word like light on gilt. */
.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.9rem, 8vw, 5.2rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: 0.03em;
  margin: 0.55rem 0 0.4rem;
}
.hero-word { display: inline-block; white-space: nowrap; }
.hero-title .ltr {
  display: inline-block;
  /* Extra room below the baseline so descenders (g, y) stay fully
     covered by the gold gradient; negative margin keeps layout identical. */
  padding-bottom: 0.09em;
  margin-bottom: -0.09em;
  background: linear-gradient(100deg,
    #9a7a24 0%,
    var(--monastery-gold) 32%,
    #fff8dc 50%,
    var(--monastery-gold) 68%,
    #9a7a24 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 0 14px rgba(230, 197, 71, 0.22));
  animation:
    heroLetterIn 0.75s cubic-bezier(0.18, 0.9, 0.26, 1.15) both,
    heroShimmer 4.2s linear infinite;
  animation-delay:
    calc(0.25s + var(--i) * 65ms),
    calc(1.1s + var(--i) * 130ms);
}
@keyframes heroShimmer {
  0%   { background-position: 130% 0; }
  100% { background-position: -170% 0; }
}
@keyframes heroLetterIn {
  from {
    opacity: 0;
    transform: translateY(0.35em) scale(0.92);
    filter: blur(6px) drop-shadow(0 0 14px rgba(230, 197, 71, 0.22));
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0) drop-shadow(0 0 14px rgba(230, 197, 71, 0.22));
  }
}

/* Gold divider with a glowing cross */
.hero-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  max-width: 22rem;
  margin: 0.6rem auto 0.55rem;
  animation: heroFadeUp 0.8s ease 0.9s both;
}
.hero-divider .hd-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(230, 197, 71, 0.55));
}
.hero-divider .hd-line:last-child {
  background: linear-gradient(270deg, transparent, rgba(230, 197, 71, 0.55));
}
.hero-divider .hd-cross {
  color: var(--accent);
  font-size: 1.05rem;
  line-height: 1;
  animation: heroCrossGlow 4s ease-in-out infinite;
}
@keyframes heroCrossGlow {
  0%, 100% { text-shadow: 0 0 8px rgba(230, 197, 71, 0.45); }
  50%      { text-shadow: 0 0 16px rgba(230, 197, 71, 0.9); }
}

/* Scripture tagline beneath the divider */
.hero-verse {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--text-secondary);
  animation: heroFadeUp 0.8s ease 1.05s both;
}
.hero-verse .hv-ref {
  display: block;
  font-style: normal;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.32rem;
}

/* Rising incense motes — faint gold dust drifting up through the light */
.hero-mote {
  position: absolute;
  bottom: 10%;
  left: var(--mx);
  width: var(--ms);
  height: var(--ms);
  border-radius: 50%;
  background: radial-gradient(circle, #fff3c4, var(--monastery-gold));
  box-shadow: 0 0 8px 2px rgba(230, 197, 71, 0.45);
  opacity: 0;
  animation: heroMote var(--md) ease-in-out var(--mdl) infinite;
  pointer-events: none;
}
@keyframes heroMote {
  0%   { opacity: 0;   transform: translateY(0) translateX(0); }
  12%  { opacity: 0.9; }
  55%  { opacity: 0.5; }
  100% { opacity: 0;   transform: translateY(-260px) translateX(14px); }
}

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

/* ---- Capability gallery ----
   A restrained discovery surface for the new-conversation view. The icons are
   intentionally monochrome so the gallery feels like part of the interface,
   rather than a collection of emoji shortcuts. */
.prompt-gallery {
  max-width: 44rem;
  margin: 0 auto;
  text-align: left;
}

.prompt-gallery-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0 0.2rem;
  margin-bottom: 0.9rem;
}

.prompt-gallery-kicker {
  margin-bottom: 0.18rem;
  color: var(--accent);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1.4;
  text-transform: uppercase;
}

.prompt-gallery h2 {
  margin: 0;
  color: var(--text-primary);
  font-family: var(--font-serif);
  font-size: 1.58rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.15;
}

.prompt-gallery-intro {
  max-width: 18rem;
  padding-bottom: 0.12rem;
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.45;
  text-align: right;
}

.empty-suggestions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.suggestion-chip {
  position: relative;
  display: grid;
  grid-template-columns: 2.55rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.82rem;
  min-height: 4.75rem;
  padding: 0.78rem 0.9rem;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.028), transparent 52%),
    rgba(20, 27, 42, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 13px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.025),
    0 8px 22px -18px rgba(0, 0, 0, 0.9);
  color: var(--text-primary);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 0.22s ease,
    background-color 0.22s ease,
    box-shadow 0.22s ease;
}

.suggestion-chip::after {
  content: '';
  position: absolute;
  inset: auto 18% 0 18%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(230, 197, 71, 0.72), transparent);
  opacity: 0;
  transform: scaleX(0.45);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.suggestion-chip:hover {
  transform: translateY(-2px);
  border-color: rgba(230, 197, 71, 0.28);
  background-color: rgba(26, 34, 51, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 12px 26px -18px rgba(0, 0, 0, 0.92),
    0 0 20px -14px rgba(230, 197, 71, 0.55);
}

.suggestion-chip:hover::after {
  opacity: 1;
  transform: scaleX(1);
}

.suggestion-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-color: rgba(230, 197, 71, 0.38);
}

.suggestion-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.55rem;
  height: 2.55rem;
  border: 1px solid rgba(230, 197, 71, 0.18);
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 30%, rgba(230, 197, 71, 0.12), transparent 72%),
    rgba(230, 197, 71, 0.045);
  color: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
  transition: border-color 0.22s ease, color 0.22s ease, box-shadow 0.22s ease;
}

.suggestion-icon svg {
  width: 1.28rem;
  height: 1.28rem;
}

.suggestion-chip:hover .suggestion-icon {
  color: var(--accent-hover);
  border-color: rgba(230, 197, 71, 0.34);
  box-shadow: 0 0 16px -8px rgba(230, 197, 71, 0.85);
}

.suggestion-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.12rem;
}

.suggestion-copy strong {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-copy > span {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.7rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-arrow {
  color: rgba(230, 197, 71, 0.42);
  font-size: 1.05rem;
  line-height: 1;
  transform: translateX(-2px);
  transition: color 0.22s ease, transform 0.22s ease;
}

.suggestion-chip:hover .suggestion-arrow {
  color: var(--accent);
  transform: translateX(1px);
}

/* ===== Conversation messages =====
   User prompts stay compact and boxed; assistant responses use the open
   reading surface so longer answers feel like prose instead of stacked cards. */
.message {
  display: flex;
  gap: 0.9rem;
  margin-bottom: 1.35rem;
  animation: slideIn 0.28s ease-out;
}

.message.user {
  justify-content: flex-end;
  padding-left: 10%;
}

.message.assistant {
  margin-bottom: 1.75rem;
}

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

.message-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.message.user .message-avatar {
  background: linear-gradient(135deg, var(--stained-glass-blue) 0%, var(--sacred-purple) 100%);
}
.message.assistant .message-avatar {
  background: linear-gradient(135deg, var(--monastery-gold) 0%, var(--accent-hover) 100%);
}

.message-content { flex: 1; min-width: 0; }

.message.user .message-content {
  flex: 0 1 auto;
  width: fit-content;
  max-width: 78%;
}

.message-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.message.user .message-header,
.message.user .message-actions {
  justify-content: flex-end;
}

.message-role { font-weight: 600; font-size: 0.84rem; color: var(--text-primary); }
.message.user .message-role { color: var(--stained-glass-blue); }
.message.assistant .message-role { color: var(--monastery-gold); }
.message-time { font-size: 0.72rem; color: var(--text-muted); }

.message-body {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0.15rem 0;
  line-height: 1.75;
  color: var(--text-primary);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.message.user .message-body {
  background: linear-gradient(135deg, rgba(91, 127, 237, 0.14), rgba(123, 63, 168, 0.10));
  border: 1px solid rgba(91, 127, 237, 0.24);
  border-radius: var(--radius-lg);
  padding: 0.8rem 1rem;
  line-height: 1.65;
  white-space: pre-wrap;
  box-shadow: var(--shadow-sm);
}

.message-body p { margin: 0 0 0.7rem 0; }
.message-body p:last-child { margin-bottom: 0; }
.message-body ul, .message-body ol { margin: 0.5rem 0 0.7rem 1.25rem; }
.message-body li { margin-bottom: 0.25rem; }
.message-body h1, .message-body h2, .message-body h3 { font-family: var(--font-serif); margin: 0.8rem 0 0.5rem; line-height: 1.3; }
.message-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 0.85rem;
  margin: 0.6rem 0;
  color: var(--text-secondary);
  font-style: italic;
}
.message.assistant .message-body a:link,
.message.assistant .message-body a:visited {
  color: var(--link-gold);
  font-weight: 600;
  text-decoration-line: underline;
  text-decoration-color: rgba(255, 215, 94, 0.82);
  text-decoration-thickness: 0.1em;
  text-underline-offset: 0.16em;
  transition: color 0.15s ease, background-color 0.15s ease, text-decoration-color 0.15s ease;
}

.message.assistant .message-body a:hover {
  color: var(--link-gold-hover);
  background: rgba(255, 215, 94, 0.09);
  text-decoration-color: currentColor;
  border-radius: 3px;
}

.message-body code {
  background: rgba(0, 0, 0, 0.32);
  padding: 0.12rem 0.38rem;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--accent);
}

.message-body pre {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem;
  overflow-x: auto;
  margin: 0.7rem 0;
}
.message-body pre code { background: none; padding: 0; color: var(--text-primary); }

.typing-indicator { display: flex; gap: 0.35rem; padding: 0.5rem 0.2rem; }
.typing-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-muted);
  animation: typing 1.4s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-6px); }
}

/* ===== Message action buttons ===== */
.message-actions {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.6rem;
  flex-wrap: wrap;
}

.message-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.4rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.message-action-btn:hover { color: var(--text-primary); background: var(--bg-raised); border-color: var(--border-hover); }
.edit-btn { color: var(--accent); border-color: rgba(230, 197, 71, 0.25); }
.edit-btn:hover { background: var(--accent-soft); border-color: rgba(230, 197, 71, 0.45); }
.regenerate-btn { color: var(--stained-glass-blue); border-color: rgba(91, 127, 237, 0.25); }
.regenerate-btn:hover { background: rgba(91, 127, 237, 0.1); border-color: rgba(91, 127, 237, 0.45); }

/* ===== Composer ===== */
.composer-container {
  border-top: 1px solid var(--border);
  background: var(--bg-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 1rem 1.5rem;
  padding-bottom: max(1rem, calc(0.75rem + env(safe-area-inset-bottom)));
  flex-shrink: 0;
}

.composer {
  max-width: var(--content-max);
  margin: 0 auto;
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.5rem 0.6rem;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.composer:focus-within {
  border-color: rgba(230, 197, 71, 0.55);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

@media (min-width: 769px) {
  .composer {
    max-width: 64rem;
  }
}

.composer-left-actions {
  display: flex;
  align-items: center;
  position: relative;
}

.composer-btn-attach,
.composer-btn-mic {
  width: 2.3rem;
  height: 2.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Higher-contrast resting state so the icons read clearly instead of
     looking faded/disabled. Brighter icon + subtle surface chip. */
  background: var(--surface-2, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}
.composer-btn-attach svg,
.composer-btn-mic svg { stroke-width: 2.1; }
.composer-btn-attach:hover,
.composer-btn-mic:hover {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent);
}
.composer-btn-attach.has-files { color: var(--accent); }

/* Mic recording / transcribing states */
.composer-btn-mic.recording {
  color: #fff;
  background: var(--recording);
  animation: micPulse 1.5s ease-in-out infinite;
}
@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}
.composer-btn-mic.transcribing { color: var(--accent); }
.composer-btn-mic.transcribing svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.composer-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  /* 16px minimum prevents iOS auto-zoom on focus */
  font-size: 16px;
  line-height: 1.5;
  resize: none;
  max-height: 180px;
  overflow-y: auto;
  padding: 0.45rem 0.25rem;
}
.composer-input::placeholder { color: var(--text-muted); }

.composer-actions { display: flex; gap: 0.4rem; align-items: flex-end; }

.composer-btn {
  width: 2.4rem;
  height: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: #1A1407;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}
.composer-btn:hover:not(:disabled) { background: var(--accent-hover); transform: translateY(-1px); }
.composer-btn:active:not(:disabled) { transform: translateY(0); }
.composer-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.composer-btn-stop {
  background: var(--accent);
  color: #1A1407;
  box-shadow: 0 0 0 1px rgba(230, 197, 71, 0.3), 0 0 14px rgba(230, 197, 71, 0.14);
}
.composer-btn-stop:hover:not(:disabled) { background: var(--accent-hover); }
.composer-btn-stop:focus-visible { outline: 2px solid var(--holy-white); outline-offset: 2px; }

/* Recording status pill (above composer) */
.recording-bar {
  display: none;
  max-width: var(--content-max);
  margin: 0 auto 0.5rem;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.85rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--text-primary);
}
.recording-bar.active { display: flex; }
.recording-bar .rec-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--recording);
  animation: pulse 1s ease-in-out infinite;
  flex-shrink: 0;
}
.recording-bar .rec-time { font-variant-numeric: tabular-nums; font-weight: 600; }
.recording-bar .rec-label { flex: 1; color: var(--text-secondary); }
.recording-bar .rec-action {
  background: transparent;
  border: 1px solid var(--border-hover);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-family: inherit;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.recording-bar .rec-action:hover { color: var(--text-primary); border-color: var(--border-strong); }
.recording-bar .rec-action.stop { color: #fff; background: var(--recording); border-color: var(--recording); }

.composer-footer {
  max-width: var(--content-max);
  margin: 0.6rem auto 0;
  text-align: center;
}
.composer-hint { font-size: 0.72rem; color: var(--text-muted); }
.composer-hint kbd {
  display: inline-block;
  padding: 0.1rem 0.35rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ===== Attachment preview ===== */
.attachment-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.55rem 0.85rem;
  max-width: var(--content-max);
  margin: 0 auto 0.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.6rem;
  background: var(--accent-soft);
  border: 1px solid rgba(230, 197, 71, 0.2);
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  color: var(--text-primary);
  max-width: 240px;
  overflow: hidden;
}
.attachment-chip .chip-icon { flex-shrink: 0; }
.attachment-chip .chip-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.attachment-chip .chip-size { flex-shrink: 0; font-size: 0.68rem; color: var(--text-muted); }
.attachment-chip .chip-remove {
  flex-shrink: 0; width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(255,255,255,0.06);
  border: none; color: var(--text-secondary); cursor: pointer;
  font-size: 0.8rem; line-height: 1; transition: var(--transition);
}
.attachment-chip .chip-remove:hover { background: rgba(244,63,94,0.15); color: var(--danger); }

.message-attachments { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.5rem; }
.message-attachment-badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.2rem 0.5rem;
  background: var(--accent-soft);
  border: 1px solid rgba(230,197,71,0.12);
  border-radius: 6px; font-size: 0.72rem; color: var(--text-secondary);
}

.composer-container.drag-over {
  outline: 2px dashed rgba(230, 197, 71, 0.5);
  outline-offset: -4px;
  background: rgba(230, 197, 71, 0.03);
}
.hint-attach { opacity: 0.7; }

/* ===== Toast ===== */
.file-error-toast {
  position: fixed;
  bottom: calc(100px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(244, 63, 94, 0.96);
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 9999;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 3s forwards;
  box-shadow: var(--shadow-lg);
  max-width: 90vw;
  text-align: center;
}
.file-error-toast.info { background: rgba(91, 127, 237, 0.96); }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateX(-50%) translateY(10px); } }

/* ============================================================
   DONATION (Feature 3)
   ============================================================ */

/* Empty-state donation card */
.donation-card {
  max-width: 38rem;
  margin: 1.5rem auto 0;
  padding: 1.25rem 1.4rem;
  background: linear-gradient(160deg, rgba(230,197,71,0.07), rgba(123,63,168,0.05));
  border: 1px solid rgba(230, 197, 71, 0.22);
  border-radius: var(--radius-lg);
  text-align: left;
}
.donation-card .dc-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.donation-card .dc-body { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: 1rem; }
.donation-card .dc-suggested { color: var(--accent); font-weight: 600; }
.donation-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.donate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.05rem;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
}
.donate-btn.primary { background: linear-gradient(135deg, var(--monastery-gold), var(--accent-hover)); color: #1A1407; }
.donate-btn.primary:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.donate-btn.secondary { background: var(--bg-elevated); border-color: var(--border-hover); color: var(--text-primary); }
.donate-btn.secondary:hover { background: var(--bg-raised); }
.donate-btn.ghost { background: transparent; color: var(--text-secondary); }
.donate-btn.ghost:hover { color: var(--text-primary); }

.donation-disclaimer { font-size: 0.78rem; color: var(--text-secondary); margin-top: 0.75rem; line-height: 1.5; }

/* Dismissible donation banner (after light usage) */
.donation-banner {
  position: fixed;
  left: 50%;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(0);
  width: min(440px, calc(100vw - 2rem));
  z-index: 400;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(230, 197, 71, 0.28);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 1rem 1.1rem;
  animation: bannerIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes bannerIn { from { opacity: 0; transform: translateX(-50%) translateY(20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
.donation-banner .db-head { display: flex; align-items: flex-start; gap: 0.5rem; margin-bottom: 0.5rem; }
.donation-banner .db-title { flex: 1; font-family: var(--font-serif); font-weight: 600; font-size: 1rem; color: var(--text-primary); }
.donation-banner .db-close {
  flex-shrink: 0; width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; color: var(--text-muted);
  border-radius: 50%; cursor: pointer; font-size: 1.1rem; line-height: 1;
}
.donation-banner .db-close:hover { background: var(--bg-elevated); color: var(--text-primary); }
.donation-banner .db-body { font-size: 0.83rem; color: var(--text-secondary); line-height: 1.55; margin-bottom: 0.85rem; }
.donation-banner .donation-buttons { gap: 0.45rem; }

/* ===== Generic modal (install help, donation other-amount) ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  animation: fadeIn 0.2s ease-out;
}
.modal {
  width: 100%;
  max-width: 30rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  animation: modalSlideIn 0.28s ease-out;
  max-height: calc(var(--app-height) - 2rem);
  overflow-y: auto;
}
@keyframes modalSlideIn { from { opacity: 0; transform: translateY(-16px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.4rem; border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-family: var(--font-serif); font-size: 1.3rem; font-weight: 600; color: var(--text-primary); }
.modal-close {
  width: 2rem; height: 2rem; display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: var(--radius-sm);
  color: var(--text-secondary); cursor: pointer; font-size: 1.3rem; line-height: 1; transition: var(--transition);
}
.modal-close:hover { background: var(--bg-elevated); color: var(--text-primary); }
.modal-body { padding: 1.4rem; }
.modal-body p { color: var(--text-secondary); margin-bottom: 0.85rem; line-height: 1.6; font-size: 0.92rem; }
.modal-body ol { color: var(--text-secondary); margin: 0 0 0.5rem 1.2rem; line-height: 1.7; font-size: 0.92rem; }
.modal-body strong { color: var(--text-primary); }
.install-step-icon { display: inline-flex; vertical-align: -3px; margin: 0 2px; }

/* ===== Mobile menu button + backdrop ===== */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: max(0.6rem, env(safe-area-inset-top));
  left: max(0.6rem, env(safe-area-inset-left));
  width: 2.6rem;
  height: 2.6rem;
  align-items: center;
  justify-content: center;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  z-index: 150;
  box-shadow: var(--shadow);
}
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  /* Must sit BELOW the sidebar (which is raised to z-index 200 on mobile)
     so taps on the drawer's close button, search, and thread items work,
     while still covering the chat content behind it. */
  z-index: 140;
  animation: fadeIn 0.2s ease-out;
}
.sidebar-backdrop.show { display: block; }

/* ===== Mobile responsive ===== */
@media (max-width: 768px) {
  :root { --sidebar-width: min(320px, 86vw); }

  .mobile-menu-btn { display: flex; }
  .sidebar-close { display: flex; }

  .chat-header { padding: 0 1rem 0 4rem; }
  .chat-title { font-size: 1.05rem; }

  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    transform: translateX(-100%);
    box-shadow: var(--shadow-xl);
    /* Raise the drawer above the backdrop so its controls are tappable. */
    z-index: 200;
  }
  .sidebar.open { transform: translateX(0); }

  .messages-inner { padding: 1.25rem 1rem; }
  .composer-container { padding: 0.75rem 0.85rem; padding-bottom: max(0.85rem, calc(0.6rem + env(safe-area-inset-bottom))); }

  .message { gap: 0.65rem; }
  .message-avatar { width: 2rem; height: 2rem; font-size: 1rem; }
  .message.user { padding-left: 0; }
  .message.user .message-content { max-width: calc(100% - 2.65rem); }

  .empty-state { padding: 1.5rem 1rem 1rem; }
  .empty-icon img { width: 220px; height: 220px; max-width: 56vw; max-height: 56vw; }
  .hero-welcome { padding-top: 1.4rem; }
  .hero-title { font-size: clamp(2.4rem, 11vw, 3.4rem); }
  .hero-rays { width: min(480px, 130vw); }
  .hero-verse { font-size: 0.92rem; }
  .liturgical-today { margin-bottom: 0.95rem; padding: 0.68rem 0.85rem; }
  .lt-title { font-size: 1rem; }
  .lt-meta { font-size: 0.74rem; }
  .prompt-gallery-heading { align-items: flex-start; flex-direction: column; gap: 0.25rem; margin-bottom: 0.75rem; }
  .prompt-gallery h2 { font-size: 1.42rem; }
  .prompt-gallery-intro { max-width: none; padding: 0; text-align: left; }
  .empty-suggestions { grid-template-columns: 1fr; }

  /* 44px minimum touch targets */
  .suggestion-chip { display: grid; min-height: 4.45rem; }
  .composer-btn, .composer-btn-attach, .composer-btn-mic { width: 44px; height: 44px; }
  .thread-action-btn, .modal-close, .sidebar-close { min-width: 40px; min-height: 40px; }
  .donate-btn { min-height: 44px; }

  .donation-card { padding: 1.1rem; }
  .donation-banner { left: 0.75rem; right: 0.75rem; width: auto; transform: none; }
  @keyframes bannerIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
}

/* Very small screens */
@media (max-width: 360px) {
  .empty-icon img { width: 180px; height: 180px; }
  .suggestion-chip { grid-template-columns: 2.35rem minmax(0, 1fr) auto; gap: 0.68rem; padding-inline: 0.72rem; }
  .suggestion-icon { width: 2.35rem; height: 2.35rem; }
  .suggestion-copy strong { font-size: 0.8rem; }
  .suggestion-copy > span { font-size: 0.66rem; }
  .composer { gap: 0.3rem; padding: 0.4rem 0.45rem; }
  .composer-btn, .composer-btn-attach, .composer-btn-mic { width: 42px; height: 42px; }
}

/* ===== Standalone PWA polish ===== */
@media (display-mode: standalone) {
  /* In installed mode, hide the in-app install help button if present */
  .install-hint-btn { display: none !important; }
}

/* ===== Scrollbars ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.16); }

/* ===== Accessibility ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
*:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:focus-visible { outline-offset: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}


/* ============================================================
   ACCOUNT IDENTITY + SETTINGS PANEL (2026-08-20)
   ============================================================ */
[hidden] { display: none !important; }
.account-card {
  width: 100%; display: flex; align-items: center; gap: .68rem; padding: .62rem .68rem;
  border: 1px solid var(--border); border-radius: var(--radius); background: rgba(255,255,255,.025);
  color: var(--text-primary); cursor: pointer; text-align: left; font-family: inherit; transition: var(--transition);
}
.account-card:hover { background: var(--bg-elevated); border-color: var(--border-hover); }
.account-avatar-wrap, .account-profile-avatar { position: relative; display: grid; place-items: center; flex: 0 0 auto; overflow: hidden; border-radius: 50%; background: linear-gradient(145deg, var(--bg-raised), #0a0e1a); border: 1px solid rgba(230,197,71,.35); color: var(--accent); font-weight: 700; }
.account-avatar-wrap { width: 34px; height: 34px; font-size: .7rem; }
.account-avatar, .account-profile-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 2; }
.account-avatar-fallback { position: relative; z-index: 1; }
.account-card-copy { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.account-card-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; font-weight: 600; }
.account-card-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); font-size: .66rem; }
.account-chevron { color: var(--text-muted); flex: 0 0 auto; }

.account-modal-overlay { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 20px; background: rgba(2,5,12,.76); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); overflow-y: auto; }
.account-modal { position: relative; width: min(620px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto; padding: 30px; border: 1px solid rgba(230,197,71,.22); border-radius: 22px; background: linear-gradient(145deg, rgba(20,27,42,.98), rgba(10,14,26,.99)); box-shadow: 0 35px 100px rgba(0,0,0,.58); }
.account-modal-close { position: absolute; right: 18px; top: 16px; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 50%; background: var(--bg-elevated); color: var(--text-secondary); font-size: 1.35rem; cursor: pointer; }
.account-modal-heading { display: flex; align-items: center; gap: 16px; padding-right: 44px; margin-bottom: 25px; }
.account-profile-avatar { width: 58px; height: 58px; font-size: 1rem; }
.account-modal-heading p { margin: 0 0 2px; color: var(--accent); font-size: .68rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.account-modal-heading h2 { margin: 0; font-family: var(--font-serif); font-size: 1.65rem; line-height: 1.1; }
.account-modal-heading small { color: var(--text-muted); }
.account-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.account-info-grid > div { padding: 14px 15px; border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,.022); }
.account-info-grid > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
.account-info-grid span { display: block; margin-bottom: 4px; color: var(--text-muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; }
.account-info-grid strong { display: block; overflow-wrap: anywhere; font-size: .86rem; font-weight: 600; color: var(--text-primary); }
.account-action-row { display: flex; gap: 10px; margin-top: 16px; }
.account-secondary-btn { flex: 1; min-height: 42px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-elevated); color: var(--text-primary); cursor: pointer; font: inherit; }
.account-secondary-btn:hover { border-color: var(--border-hover); background: var(--bg-raised); }
.account-privacy-note { margin: 18px 0; padding: 13px 14px; border-radius: 11px; background: rgba(91,127,237,.08); color: var(--text-secondary); font-size: .78rem; line-height: 1.55; }
.account-privacy-note a { color: var(--link-gold); }
.account-danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 18px; padding: 17px; border: 1px solid rgba(244,63,94,.32); border-radius: 13px; background: rgba(244,63,94,.065); }
.account-danger-zone div { display: flex; flex-direction: column; gap: 3px; }
.account-danger-zone strong { color: #ffd4dc; font-size: .88rem; }
.account-danger-zone span { color: var(--text-muted); font-size: .72rem; line-height: 1.45; }
.account-danger-zone button, .account-delete-confirm { border: 0; border-radius: 999px; background: #d92f4c; color: white; font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; }
.account-danger-zone button { padding: 10px 14px; font-size: .75rem; }
.account-danger-eyebrow { margin: 0 0 8px; color: #ff8ca0; font-size: .68rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.account-delete-modal h2 { margin: 0 0 12px; font-family: var(--font-serif); font-size: 1.8rem; }
.account-delete-modal > p:not(.account-danger-eyebrow) { color: var(--text-secondary); font-size: .88rem; line-height: 1.6; }
.account-delete-label { display: block; margin: 15px 0 7px; color: var(--text-secondary); font-size: .78rem; }
.account-delete-input { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 9px; background: #0a0f1b; color: var(--text-primary); font: inherit; }
.account-delete-input:focus { outline: 2px solid rgba(230,197,71,.45); outline-offset: 1px; }
.account-delete-message { min-height: 22px; margin-top: 12px; color: #ffc2cc; font-size: .78rem; }
.account-delete-confirm { width: 100%; min-height: 44px; margin-top: 10px; }
.account-delete-confirm:disabled { opacity: .42; cursor: not-allowed; }

@media (max-width: 640px) {
  .account-modal { padding: 24px 18px; }
  .account-info-grid { grid-template-columns: 1fr; }
  .account-action-row, .account-danger-zone { flex-direction: column; align-items: stretch; }
  .account-danger-zone button { width: 100%; }
}
/* ===== Reading release 1. Scoped to chat.html; other ministry pages retain their design. ===== */
html[data-reading-theme="dark"] { color-scheme: dark; }
html[data-reading-theme="light"] {
  color-scheme: light;
  --bg-primary: #F7F4ED; --bg-secondary: #EFEBE2; --bg-elevated: #FFFDFA; --bg-raised: #E9E3D7;
  --bg-glass: rgba(247,244,237,.94); --bg-glass-strong: rgba(247,244,237,.98);
  --text-primary: #242A36; --text-secondary: #505865; --text-muted: #626975;
  --border: rgba(51,43,23,.15); --border-hover: rgba(51,43,23,.28); --border-strong: rgba(51,43,23,.35);
  --accent: #785518; --accent-hover: #674514; --accent-soft: rgba(120,85,24,.08);
  --monastery-gold: #785518; --link-gold: #715018; --link-gold-hover: #51380B;
  --stained-glass-blue: #34558C; --shadow-sm: 0 2px 6px rgba(40,30,10,.04);
}
.reading-release { --answer-size: 1rem; }
html[data-reading-size="large"] .reading-release { --answer-size: 1.125rem; }
html[data-reading-size="larger"] .reading-release { --answer-size: 1.25rem; }
.reading-release .ambient-bg { opacity: .25; }
.reading-release .messages-inner { max-width: 54rem; padding: 2rem 2.2rem; }
.reading-release .empty-state { padding: .5rem 0 1rem; }
.reading-release .hero-welcome { padding: .3rem 0 1.65rem; margin: 0; text-align: center; }
.welcome-candle { width: 36px; height: 52px; margin: 0 auto .65rem; color: var(--accent); }
.welcome-candle svg { width: 100%; height: 100%; }
.welcome-kicker { color: var(--accent); font-size: .66rem; font-weight: 600; letter-spacing: .16em; line-height: 1.6; }
.welcome-title { font-family: var(--font-serif); color: var(--text-primary); font-size: clamp(2rem, 3.4vw, 3rem); font-weight: 500; line-height: 1.13; margin: .6rem 0 .65rem; letter-spacing: -.025em; }
.welcome-description { color: var(--text-secondary); font-size: .96rem; line-height: 1.65; margin: 0; }
.welcome-scripture { font-family: var(--font-serif); font-style: italic; color: var(--text-secondary); font-size: 1rem; margin: 1rem auto 0; max-width: 34rem; }
.welcome-scripture span { display: block; margin-top: .2rem; color: var(--text-muted); font: .7rem var(--font-sans); }
.reading-release .liturgical-today { max-width: none; width: 100%; margin: 0 0 1.5rem; padding: 1.05rem 1.3rem; text-align: left; border: 1px solid var(--border-hover); background: var(--accent-soft); border-radius: 14px; }
.reading-release .lt-title { font-size: 1.38rem; color: var(--text-primary); }
.reading-release .lt-meta { color: var(--text-secondary); }
.today-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .7rem; }
.reading-release .prompt-gallery { max-width: none; margin-top: 0; }
.reading-release .prompt-gallery-heading { margin-bottom: .8rem; }
.reading-release .prompt-gallery h2 { font-size: 1.55rem; }
.reading-release .prompt-gallery-kicker { display: none; }
.reading-release .empty-suggestions { gap: .6rem; }
.reading-release .suggestion-chip { min-height: 4.2rem; padding: .75rem .85rem; box-shadow: none; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 11px; transform: none; }
.reading-release .suggestion-chip::before, .reading-release .suggestion-chip::after { display: none; }
.reading-release .suggestion-chip:hover { background: var(--bg-elevated); border-color: var(--accent); }
.reading-release .suggestion-icon { width: 2.25rem; height: 2.25rem; border-radius: 8px; color: var(--accent); background: var(--accent-soft); box-shadow: none; }
.reading-release .suggestion-copy strong { font-size: .84rem; color: var(--text-primary); }
.reading-release .suggestion-copy > span { font-size: .75rem; color: var(--text-secondary); }
.welcome-support { margin: 1.35rem auto .3rem; color: var(--text-muted); font-size: .76rem; text-align: center; line-height: 1.8; }
.welcome-support a { margin-left: .25rem; color: var(--accent); text-underline-offset: 3px; }
.reading-release .chat-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reading-release .chat-header { gap: .6rem; }
.header-reading-actions { display: flex; align-items: center; gap: .25rem; flex-shrink: 0; }
.reading-tool { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 40px; padding: .45rem .75rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-elevated); color: var(--text-secondary); font: 500 .8rem var(--font-sans); cursor: pointer; text-decoration: none; }
.reading-tool:hover { border-color: var(--accent); color: var(--text-primary); }
.reading-tool:disabled { opacity: .45; cursor: not-allowed; }
.reading-tool[aria-pressed="true"], .reading-tool.reading-primary { color: var(--text-primary); background: var(--accent-soft); border-color: var(--accent); }
.saved-answers-nav { display: flex; gap: .65rem; align-items: center; margin: 0 1rem .7rem; padding: .5rem .75rem; min-height: 44px; background: transparent; border: 1px solid var(--border); border-radius: 9px; color: var(--text-primary); font: 500 .85rem var(--font-sans); cursor: pointer; }
.saved-answers-nav > span:first-child { color: var(--accent); font-size: 1.3rem; }
.saved-answers-nav #savedAnswersCount { margin-left: auto; color: var(--text-secondary); font-size: .75rem; }
.resume-conversation { display: grid; grid-template-columns: 1fr auto; gap: .3rem; width: 100%; padding: .8rem 1rem; margin-bottom: .85rem; text-align: left; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 10px; color: var(--text-primary); cursor: pointer; }
.resume-conversation span:first-child { color: var(--text-muted); font-size: .7rem; }
.resume-conversation strong { grid-column: 1; font: 500 .85rem var(--font-sans); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resume-conversation span:last-child { grid-column: 2; grid-row: 1 / 3; align-self: center; color: var(--accent); }
.reading-release .message-body { font-size: var(--answer-size); line-height: 1.8; }
.reading-release .message-body h1 { font-size: 1.75em; }
.reading-release .message-body h2 { font-size: 1.45em; }
.reading-release .message-body h3 { font-size: 1.2em; }
.reading-release .message { margin-bottom: 2.3rem; }
.reading-release .message-actions { gap: .3rem; }
.reading-release .message-action-btn { background: transparent; border-color: transparent; min-height: 36px; padding: .35rem .6rem; color: var(--text-secondary); }
.reading-release .message-action-btn:hover { background: var(--bg-elevated); border-color: var(--border); }
.reading-release .save-answer-btn[aria-pressed="true"] { color: var(--accent); }
.reading-release .message-streaming .save-answer-btn, .reading-release .message-streaming .print-answer-btn { display: none; }
.reading-release .message-body table { display: block; overflow-x: auto; max-width: 100%; border-collapse: collapse; margin: 1rem 0; }
.reading-release .message-body th, .reading-release .message-body td { padding: .55rem .7rem; border: 1px solid var(--border); text-align: left; }
.reading-release .message-body img { max-width: 100%; height: auto; }
.reading-release.reading-focus .sidebar, .reading-release.reading-focus .mobile-menu-btn { display: none; }
.reading-release.reading-focus .messages-inner { max-width: 49rem; }
.reading-release.reading-focus .chat-header { padding-left: 1rem; }
.reading-release.reading-focus .message-avatar, .reading-release.reading-focus .message-time { display: none; }
.reading-release.reading-focus .message.user { padding-left: 0; }
.reading-dialog { color: var(--text-primary); background: var(--bg-primary); border: 1px solid var(--border-hover); border-radius: 18px; padding: 1.5rem; margin: auto; width: min(560px, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); overflow: auto; box-shadow: 0 20px 90px rgba(0,0,0,.25); }
.reading-dialog::backdrop { background: rgba(3,7,15,.65); backdrop-filter: blur(5px); }
.reading-dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.reading-dialog-head h2 { font: 500 1.8rem/1.2 var(--font-serif); color: var(--text-primary); }
.reading-dialog-head [data-close-dialog] { min-width: 40px; flex-shrink: 0; font-size: 1.2rem; }
.reading-fields { display: grid; gap: .6rem; }
.reading-fields label { color: var(--text-secondary); font-size: .88rem; }
.reading-dialog select, .reading-dialog input, .reading-dialog textarea { width: 100%; padding: .7rem .8rem; border: 1px solid var(--border-hover); border-radius: 8px; background: var(--bg-elevated); color: var(--text-primary); font: 1rem/1.5 var(--font-sans); }
.reading-dialog textarea { resize: vertical; min-height: 4rem; }
.reading-fields select { margin-bottom: .65rem; }
.reading-note { font: .8rem/1.6 var(--font-sans); color: var(--text-secondary); margin: .5rem 0 1rem; }
.reading-dialog-actions, .saved-card-actions { display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
#editMessageError { color: #e76279; font-size: .85rem; margin-top: .6rem; }
.saved-dialog { width: min(760px, calc(100vw - 2rem)); }
.saved-tools { display: flex; gap: .6rem; margin-bottom: 1rem; }
.saved-tools input { min-width: 0; flex: 1; }
.saved-tools button { flex-shrink: 0; }
.saved-answer { padding: 1.1rem 0; border-top: 1px solid var(--border); }
.saved-answer h3 { font: 500 1.35rem var(--font-serif); }
.saved-answer summary { cursor: pointer; color: var(--accent); padding: .5rem 0; font-size: .9rem; }
.saved-answer label { display: block; margin-top: .8rem; color: var(--text-secondary); font-size: .8rem; }
.saved-answer label textarea { display: block; margin-top: .4rem; }
.saved-empty { padding: 2rem .7rem; text-align: center; color: var(--text-secondary); line-height: 1.7; }
.release-toast { position: fixed; z-index: 11000; top: max(4.5rem, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); max-width: min(520px, 90vw); padding: .8rem 1rem; border-radius: 10px; background: var(--bg-elevated); border: 1px solid var(--border-hover); color: var(--text-primary); box-shadow: var(--shadow-lg); font-size: .85rem; pointer-events: none; }
.print-dialog { width: min(860px, calc(100vw - 2rem)); }
#printContent { background: white; color: #20242b; padding: 2rem; margin-top: 1.2rem; border-radius: 5px; }
#printContent .message-body { color: #20242b; font-size: 1rem; }
#printContent h1 { font: 600 2rem/1.2 var(--font-serif); margin: .6rem 0 1.5rem; }
#printContent h2 { color: #343941; font-size: 1rem; margin: 1.2rem 0 .5rem; }
#printContent .message-body h2 { font: 600 1.4rem var(--font-serif); }
#printContent a, #printContent blockquote { color: #654b19; }
#printContent pre, #printContent code { color: #20242b; background: #f4f3f0; }
.print-brand { color: #705322; font-size: .68rem; font-weight: 600; letter-spacing: .12em; }
.print-source-links { font-size: .8rem; overflow-wrap: anywhere; padding-left: 1.2rem; }
html[data-reading-theme="light"] .reading-release .sidebar,
html[data-reading-theme="light"] .reading-release .chat-header,
html[data-reading-theme="light"] .reading-release .composer-container,
html[data-reading-theme="light"] .reading-release .composer { background: var(--bg-primary); }
html[data-reading-theme="light"] .reading-release .brand-icon,
html[data-reading-theme="light"] .reading-release .message-avatar { background: var(--accent-soft); }
html[data-reading-theme="light"] .reading-release .account-modal { background: var(--bg-primary); }
html[data-reading-theme="light"] .reading-release .account-delete-input { background: var(--bg-elevated); }
html[data-reading-theme="light"] .reading-release .account-danger-zone strong { color: #9b203a; }
html[data-reading-theme="light"] .reading-release .account-avatar-wrap,
html[data-reading-theme="light"] .reading-release .account-profile-avatar { background: var(--bg-secondary); }
html[data-reading-theme="light"] .reading-release .composer-btn { color: #fff; }
html[data-reading-theme="light"] .reading-release .message-body pre,
html[data-reading-theme="light"] .reading-release .message-body code { background: #eae5d9; }
@media (max-width: 768px) {
  .reading-release .messages-inner { padding: 1rem; }
  .reading-release .chat-header { gap: .25rem; padding-right: .55rem; }
  .reading-release .chat-title { font-size: .88rem; }
  .reading-release .chat-status { display: none; }
  .reading-release .reading-tool { min-height: 44px; }
  .header-reading-actions .reading-tool { padding-inline: .55rem; }
  .reading-release .hero-welcome { padding-bottom: 1.2rem; }
  .welcome-kicker { font-size: .6rem; }
  .welcome-title { font-size: 2.15rem; }
  .welcome-description { font-size: .88rem; }
  .welcome-scripture { font-size: .96rem; }
  .reading-release .empty-suggestions { grid-template-columns: 1fr; }
  .reading-release .suggestion-chip { min-height: 3.75rem; padding-block: .6rem; }
  .reading-release .message-action-btn { min-height: 44px; }
  .reading-release .message-avatar { width: 1.6rem; height: 1.6rem; }
  .reading-dialog { padding: 1.1rem; }
  .saved-tools { flex-direction: column; }
  #printContent { padding: 1rem; }
}
@media print {
  @page { size: auto; margin: 18mm; }
  html, body.reading-release { height: auto !important; overflow: visible !important; background: white !important; color: black !important; }
  body.reading-release > * { display: none !important; }
  body.reading-release > #printDialog { display: block !important; position: static !important; margin: 0 !important; padding: 0 !important; width: 100% !important; max-width: none !important; height: auto !important; max-height: none !important; overflow: visible !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; background: white !important; }
  #printDialog::backdrop { display: none; }
  #printDialog .print-controls { display: none !important; }
  #printContent { padding: 0; margin: 0; }
  #printContent .message-body { font: 11pt/1.55 Georgia, serif; }
  #printContent h1, #printContent h2, #printContent h3 { break-after: avoid; }
  #printContent p, #printContent li { orphans: 3; widows: 3; }
  #printContent table { display: table; width: 100%; font-size: 9pt; }
  #printContent pre { white-space: pre-wrap; overflow-wrap: anywhere; }
}

.reading-release .composer { max-width: 52rem; }
.reading-release .brand-icon svg { width: 27px; height: 40px; color: var(--accent); }
html[data-reading-theme="light"] .reading-release .btn-new-chat { color: white; }
.reading-release .reading-tool:focus-visible, .reading-dialog summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

html[data-reading-theme="light"] .reading-release .sidebar-journey-link,
html[data-reading-theme="light"] .reading-release .sidebar-journey-link:hover { background: var(--bg-secondary); border-color: var(--border-hover); }
html[data-reading-theme="light"] .reading-release .sidebar-journey-copy strong { color: var(--accent); }
html[data-reading-theme="light"] .reading-release .sidebar-journey-copy small { color: var(--text-secondary); }

.reading-release .message:not(.message-streaming) .regenerate-btn { display: inline-flex !important; }
.reading-release .message:not(.message-streaming) .stop-btn { display: none !important; }