/* 2026-11-13: Final responsive Sanctuary guidance and spacing pass.
   This dedicated sheet loads after site.css and overrides older, conflicting
   rules without changing any payment, voice, or account JavaScript. */
.bible-assistant-view .bible-conversation > .conversation-start-guide:not([hidden]) {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "instructions close" "targets targets";
  gap: .25rem .5rem !important;
  align-items: center !important;
  box-sizing: border-box;
  width: calc(100% - .7rem) !important;
  margin: .28rem .35rem 0 !important;
  padding: .4rem .6rem .24rem !important;
  border-radius: .8rem;
  background: #fff7df;
  border: 1px solid #c89b48;
  color: #173f32;
}
.bible-assistant-view .conversation-start-guide__content { grid-area: instructions; min-width: 0; }
.bible-assistant-view .conversation-start-guide__dismiss { grid-area: close; align-self: start; }
.bible-assistant-view .conversation-start-guide__targets {
  grid-area: targets;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem; align-items: end; min-width: 0; width: 100%; padding: 0;
}
.bible-assistant-view .conversation-start-guide__target {
  display: flex; flex-direction: column; align-items: center;
  justify-content: flex-end; gap: 0; min-width: 0;
  color: #8f1d2c; line-height: 1; text-align: center;
}
.bible-assistant-view .conversation-start-guide__target strong {
  font: 800 clamp(.7rem, 1.45vw, .84rem)/1.15 system-ui, sans-serif;
  color: #8f1d2c; overflow-wrap: anywhere;
}
.bible-assistant-view .conversation-start-guide__arrow {
  display: block; color: #a31d30;
  font: 900 1.48rem/.96 system-ui, sans-serif;
}
.bible-assistant-view .bible-conversation > .conversation-action-bar {
  margin-top: 0 !important; align-self: stretch;
}
/* Keep the support link immediately after the controls instead of leaving
   a deep, empty ivory-colored block at the bottom of phone screens. */
body.bible-assistant-view, .bible-assistant-view main { background: #173f32; }

.fundraising-group-choice { margin: .65rem 0; padding: .75rem; border: 1px solid #d4c6a4; border-radius: 14px; background: #fff9ec; color: #173f32; }
.fundraising-group-choice label { display: block; font-weight: 800; margin-bottom: .35rem; }
.fundraising-group-choice select { display: block; box-sizing: border-box; width: 100%; max-width: 100%; min-height: 44px; padding: .5rem; border: 2px solid #173f32; border-radius: 10px; background: #fff; color: #173f32; font: inherit; font-weight: 700; }
.fundraising-group-choice small { display: block; margin-top: .3rem; line-height: 1.4; }

/* Separate frame rows: purchase content never travels underneath this cue. */
.bible-assistant-view .question-choice-frame { display: flex; flex-direction: column; width: min(1280px, 100%); max-height: calc(100dvh - 1rem); min-height: 0; overflow: hidden; border: 2px solid #c89b48; border-radius: 1.4rem; background: #fffdf8; box-shadow: 0 20px 80px #0008; }
.bible-assistant-view .question-choice-frame > .question-choice-dialog { flex: 1 1 auto; box-sizing: border-box; width: 100% !important; min-height: 0; max-height: none !important; overflow-y: auto; overscroll-behavior: contain; border: 0; border-radius: 0; box-shadow: none; }
.bible-assistant-view .question-choice-scroll-content { min-width: 0; display: flow-root; }
.bible-assistant-view .question-choice-scroll-dock { flex: 0 0 52px; height: 52px; min-height: 52px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; padding: 4px 10px; border-top: 1px solid #d4c6a4; background: #fffdf8; }
.bible-assistant-view .question-choice-scroll-cue { min-height: 44px; padding: .4rem 1.1rem; border: 2px solid #fffdf8; border-radius: 999px; background: #173f32; color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.bible-assistant-view .question-choice-scroll-cue[hidden] { display: none !important; }
.bible-assistant-view .question-choice-scroll-cue:focus-visible { outline: 3px solid #8f1d2c; outline-offset: -3px; }
.bible-assistant-view .question-choice-overlay--guest .question-choice-frame { width: min(660px, 100%); }
.bible-assistant-view .biblical-support-shortcut {
  width: 100%; max-width: none; margin: 0 !important;
  padding: .4rem max(.6rem, env(safe-area-inset-left)) max(.55rem, env(safe-area-inset-bottom)) !important;
  box-sizing: border-box; text-align: center;
  font-size: .9rem; line-height: 1.35; color: #fff; background: #173f32;
}
.bible-assistant-view .biblical-support-shortcut a {
  color: #fff; font-weight: 750; text-underline-offset: .2em;
}
.bible-assistant-view .biblical-support-shortcut span {
  display: block; font-size: .79rem !important; margin-top: .15rem !important;
  color: #f2f1eb; opacity: 1 !important;
}
@media (min-width: 761px) and (max-width: 1020px) {
  .bible-assistant-view .conversation-start-guide__targets {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  /* Explicit order is essential: old CSS sent the guide below the controls. */
  .bible-assistant-view .bible-conversation > .conversation-main { order: 0 !important; }
  .bible-assistant-view .bible-conversation > .conversation-start-guide { order: 1 !important; }
  .bible-assistant-view .bible-conversation > .conversation-action-bar { order: 2 !important; }
  .bible-assistant-view .bible-conversation > .conversation-see-more { order: 3 !important; }
  .bible-assistant-view .bible-conversation > .conversation-start-guide:not([hidden]) {
    width: calc(100% - .5rem) !important; margin: .12rem .25rem 0 !important;
    padding: .32rem .45rem .13rem !important; gap: .15rem .2rem !important;
  }
  .bible-assistant-view .conversation-start-guide__targets {
    grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .15rem;
  }
  .bible-assistant-view .conversation-start-guide__target strong {
    font-size: clamp(.7rem, 2.8vw, .85rem);
  }
  .bible-assistant-view .conversation-start-guide__arrow { font-size: 1.4rem; }
  .bible-assistant-view .conversation-start-guide__content {
    font-size: clamp(.73rem, 2.3vw, .9rem) !important; line-height: 1.24 !important;
  }
  .bible-assistant-view .conversation-start-guide__content strong {
    font-size: clamp(.83rem, 2.8vw, 1rem) !important;
  }
  .bible-assistant-view .conversation-avatar-panel,
  .bible-assistant-view .bible-conversation.mobile-speaking-active .conversation-avatar-panel {
    height: clamp(15rem, 34dvh, 22rem) !important;
    min-height: clamp(15rem, 34dvh, 22rem) !important;
    flex: 0 0 clamp(15rem, 34dvh, 22rem) !important;
    max-height: none !important;
  }
  .bible-assistant-view .conversation-avatar-panel .special-bible-avatar__portrait,
  .bible-assistant-view .conversation-avatar-panel .special-bible-avatar__eye-layer,
  .bible-assistant-view .conversation-avatar-panel .special-bible-avatar__mouth-layer {
    object-fit: contain !important; transform: scale(1.08) !important;
    transform-origin: center 32% !important;
  }
  /* Give answered questions a readable, independently scrollable transcript. */
  .bible-assistant-view .bible-conversation:not(.mobile-speaking-active)
  .conversation-history:not(:has(.conversation-empty:not([hidden]))) .conversation-log {
    height: clamp(14rem, 34dvh, 25rem) !important;
    max-height: clamp(14rem, 34dvh, 25rem) !important;
    min-height: 0 !important; overflow-y: auto !important;
  }
  .bible-assistant-view .conversation-action-bar .mic-button,
  .bible-assistant-view .conversation-action-bar .type-instead-control {
    min-height: 2.85rem !important;
  }
  .bible-assistant-view .ask-conversation-hero--dedicated { padding-bottom: 0 !important; }
}
@media (max-width: 360px) {
  .bible-assistant-view .conversation-start-guide__content { font-size: .72rem !important; }
  .bible-assistant-view .conversation-start-guide__content strong { font-size: .8rem !important; }
  .bible-assistant-view .conversation-start-guide__target strong { font-size: .69rem; }
}
@media (min-width: 761px) and (max-height: 650px) {
  body.bible-assistant-view { overflow-y: auto !important; }
  .bible-assistant-view .bible-conversation { height: auto !important; max-height: none !important; }
  .bible-assistant-view .conversation-main { min-height: 30rem; }
}
@media (prefers-reduced-motion: reduce) {
  .bible-assistant-view .conversation-start-guide__arrow { animation: none !important; }
}

/* Explicit guide reopening control and arrows aligned with the two action buttons. */
.bible-assistant-view .conversation-guide-restore:not([hidden]) { display: block; width: max-content; max-width: 100%; margin: .2rem auto; padding: .35rem .65rem; border: 2px solid #b48b35; border-radius: .5rem; background: #fff7df; color: #173f32; font-weight: 800; cursor: pointer; }
.bible-assistant-view .conversation-start-guide__targets { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: .25rem !important; }
.bible-assistant-view .conversation-start-guide__target { justify-self: center; width: 100%; }
/* Preserve an unobstructed reading surface: the portrait stays in its own row. */
@media (max-width: 1024px) {
 .bible-assistant-view .conversation-main { overflow: visible !important; }
 .bible-assistant-view .conversation-avatar-panel { position: sticky !important; top: calc(4.9rem + env(safe-area-inset-top)) !important; z-index: 10 !important; background: #fffdf8; }
 .bible-assistant-view .conversation-history, .bible-assistant-view .conversation-log { position: relative; z-index: 11; background: #fffdf8; }
}

/* Keep voice preparation visible near the answer instead of offscreen in the composer. */
.bible-assistant-view .conversation-speech-preparing:not([hidden]) { position: sticky; bottom: .3rem; z-index: 18; margin: .25rem 0; box-shadow: 0 2px 8px #0002; }
.bible-assistant-view .conversation-speech-preparing[hidden], .bible-assistant-view .conversation-guide-restore[hidden] { display: none !important; }

/* 2026-11-15 Codex matrix repairs: preserve real layout separation.
   Avoid sticky portrait/status paint-order collisions in entry and playback. */
.bible-assistant-view .conversation-main {
  min-width: 0 !important;
  align-items: stretch !important;
}
.bible-assistant-view .conversation-avatar-panel,
.bible-assistant-view .bible-conversation.mobile-speaking-active .conversation-avatar-panel {
  position: relative !important;
  top: auto !important;
  bottom: auto !important;
  z-index: auto !important;
  box-sizing: border-box;
  overflow: hidden !important;
}
.bible-assistant-view .conversation-avatar-panel .special-bible-avatar,
.bible-assistant-view .conversation-avatar-panel .special-bible-avatar__frame {
  max-width: 100%;
  overflow: hidden !important;
}
.bible-assistant-view .conversation-avatar-panel .special-bible-avatar__portrait,
.bible-assistant-view .conversation-avatar-panel .special-bible-avatar__eye-layer,
.bible-assistant-view .conversation-avatar-panel .special-bible-avatar__mouth-layer {
  object-fit: contain !important;
  object-position: center bottom !important;
  transform: none !important;
}
.bible-assistant-view .bible-conversation__workspace,
.bible-assistant-view .conversation-history,
.bible-assistant-view .conversation-log {
  min-width: 0 !important;
}
.bible-assistant-view .conversation-history,
.bible-assistant-view .conversation-log {
  position: relative;
  z-index: auto !important;
}
.bible-assistant-view .conversation-speech-preparing:not([hidden]) {
  position: relative !important;
  inset: auto !important;
  z-index: auto !important;
  flex: 0 0 auto;
  margin: .35rem .5rem !important;
  max-width: calc(100% - 1rem);
  box-sizing: border-box;
}
/* The guide's first two columns must correspond to the first two real
   action-bar buttons; other controls consume the remaining grid tracks. */
.bible-assistant-view .conversation-start-guide__targets {
  grid-template-columns: 1.15fr 1fr .92fr 1.25fr 1.15fr !important;
  gap: .75rem !important;
}
.bible-assistant-view .conversation-start-guide__target {
  min-width: 0;
}
.bible-assistant-view .conversation-start-guide__target strong {
  overflow-wrap: normal !important;
  word-break: normal !important;
  white-space: normal;
}
@media (min-width: 761px) and (max-width: 1020px) {
  .bible-assistant-view .conversation-start-guide__targets {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: .55rem !important;
  }
}
@media (max-width: 760px) {
  .bible-assistant-view .conversation-main,
  .bible-assistant-view .bible-conversation.mobile-speaking-active .conversation-main {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    overflow: visible !important;
  }
  .bible-assistant-view .conversation-avatar-panel,
  .bible-assistant-view .bible-conversation.mobile-speaking-active .conversation-avatar-panel {
    align-self: stretch !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
  }
  .bible-assistant-view .bible-conversation__workspace {
    position: relative;
    flex: 0 0 auto !important;
    overflow: visible !important;
  }
  .bible-assistant-view .conversation-start-guide__targets {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: .25rem !important;
  }
  .bible-assistant-view .conversation-start-guide__target strong {
    font-size: .72rem !important;
    line-height: 1.2 !important;
  }
}
@media (max-width: 760px) and (max-height: 650px) {
  /* Short phones: keep Pastor large enough to see but free more actual
     workspace height; never overlay the editor to mimic a compact view. */
  .bible-assistant-view .conversation-avatar-panel,
  .bible-assistant-view .bible-conversation.mobile-speaking-active .conversation-avatar-panel {
    height: clamp(11.5rem, 30dvh, 14rem) !important;
    min-height: clamp(11.5rem, 30dvh, 14rem) !important;
    flex-basis: clamp(11.5rem, 30dvh, 14rem) !important;
  }
}

/* 2026-11-15 follow-up: keep the portrait in a reserved non-scrolling row,
   without permitting the transcript/editor to draw over it. */
@media (max-width: 850px) {
  .bible-assistant-view .conversation-main,
  .bible-assistant-view .bible-conversation.mobile-speaking-active .conversation-main {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: var(--sanctuary-visible-avatar-height) minmax(0, 1fr) !important;
    --sanctuary-visible-avatar-height: clamp(10.5rem, 29dvh, 16rem);
    height: max(22rem, calc(100dvh - 8.75rem)) !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
    align-content: stretch !important;
  }
  .bible-assistant-view .conversation-avatar-panel,
  .bible-assistant-view .bible-conversation.mobile-speaking-active .conversation-avatar-panel {
    grid-row: 1 !important;
    grid-column: 1 !important;
    position: relative !important;
    top: auto !important;
    width: 100% !important;
    height: var(--sanctuary-visible-avatar-height) !important;
    min-height: 0 !important;
    max-height: var(--sanctuary-visible-avatar-height) !important;
    flex: none !important;
    overflow: hidden !important;
    align-self: stretch !important;
  }
  .bible-assistant-view .conversation-avatar-panel .special-bible-avatar {
    height: 100% !important;
    max-height: 100% !important;
  }
  .bible-assistant-view .bible-conversation__workspace,
  .bible-assistant-view .bible-conversation.mobile-speaking-active .bible-conversation__workspace {
    grid-row: 2 !important;
    grid-column: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    flex: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain;
    scroll-padding-block: .5rem;
  }
  .bible-assistant-view .conversation-speech-preparing:not([hidden]) {
    position: sticky !important;
    top: 0 !important;
    align-self: stretch;
    z-index: 5 !important;
  }
}
@media (max-width: 850px) and (max-height: 650px) {
  .bible-assistant-view .conversation-main {
    --sanctuary-visible-avatar-height: clamp(9rem, 27dvh, 12rem);
  }
}
@media (min-width: 851px) {
  /* Desktop keeps its side-by-side portrait; the status stays in the
     separately scrolling workspace instead of disappearing above the page. */
  .bible-assistant-view .conversation-main {
    height: min(75dvh, 42rem) !important;
    min-height: min(24rem, 75dvh) !important;
    overflow: hidden !important;
  }
  .bible-assistant-view .bible-conversation__workspace {
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain;
  }
  .bible-assistant-view .conversation-speech-preparing:not([hidden]) {
    position: sticky !important;
    top: 0 !important;
    z-index: 5 !important;
  }
}
/* Actual button centers are supplied by ask.js after layout.
   Do not attempt to match dissimilar guide/action bar grids. */
.bible-assistant-view .conversation-start-guide__targets {
  position: relative !important;
  display: block !important;
  height: 2.75rem !important;
  min-height: 2.75rem !important;
  overflow: visible !important;
}
.bible-assistant-view .conversation-start-guide__target {
  position: absolute !important;
  top: 0 !important;
  left: 0;
  display: flex !important;
  width: min(8.5rem, calc(50% - .25rem)) !important;
  max-width: 50% !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 0 !important;
  pointer-events: none;
}
.bible-assistant-view .conversation-start-guide__target strong {
  font-size: clamp(.65rem, 2.5vw, .82rem) !important;
  white-space: nowrap !important;
  overflow-wrap: normal !important;
}
@media (max-width: 360px) {
  .bible-assistant-view .conversation-start-guide__target {
    width: calc(50% - .25rem) !important;
  }
  .bible-assistant-view .conversation-start-guide__target strong {
    font-size: .65rem !important;
  }
}

/* 2026-11-15: Pin the *entire* reading frame under the actual site header.
   Earlier attempts pinned only the portrait inside an outer scrolling page,
   so the whole portrait/workspace frame still scrolled behind the header.
   This mode starts only after conversation content or audio preparation. */
.bible-assistant-view .bible-conversation:is(.question-answer-completed, .mobile-speaking-active),
.bible-assistant-view .bible-conversation:has(.conversation-log .conversation-message),
.bible-assistant-view .bible-conversation:has(.conversation-speech-preparing:not([hidden])) {
  position: fixed !important;
  z-index: 75 !important;
  top: calc(var(--sanctuary-header-bottom, 5.75rem) + .2rem) !important;
  right: max(.35rem, env(safe-area-inset-right)) !important;
  bottom: calc(4.25rem + env(safe-area-inset-bottom)) !important;
  left: max(.35rem, env(safe-area-inset-left)) !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: hidden !important;
  background: #fffdf8;
}
/* In the pinned reading mode, the guide is no longer needed and its space
   must not steal room from the portrait, answer, or usable controls. */
.bible-assistant-view .bible-conversation:is(.question-answer-completed, .mobile-speaking-active) > .conversation-start-guide,
.bible-assistant-view .bible-conversation:has(.conversation-log .conversation-message) > .conversation-start-guide,
.bible-assistant-view .bible-conversation:has(.conversation-speech-preparing:not([hidden])) > .conversation-start-guide,
.bible-assistant-view .bible-conversation:is(.question-answer-completed, .mobile-speaking-active) > .conversation-guide-restore,
.bible-assistant-view .bible-conversation:has(.conversation-log .conversation-message) > .conversation-guide-restore,
.bible-assistant-view .bible-conversation:has(.conversation-speech-preparing:not([hidden])) > .conversation-guide-restore {
  display: none !important;
}
.bible-assistant-view .bible-conversation:is(.question-answer-completed, .mobile-speaking-active) > .conversation-main,
.bible-assistant-view .bible-conversation:has(.conversation-log .conversation-message) > .conversation-main,
.bible-assistant-view .bible-conversation:has(.conversation-speech-preparing:not([hidden])) > .conversation-main {
  position: relative !important;
  top: auto !important;
  bottom: auto !important;
  flex: 1 1 auto !important;
  height: auto !important;
  max-height: none !important;
  min-height: 0 !important;
  overflow: hidden !important;
}
.bible-assistant-view .bible-conversation:is(.question-answer-completed, .mobile-speaking-active) > .conversation-action-bar,
.bible-assistant-view .bible-conversation:has(.conversation-log .conversation-message) > .conversation-action-bar,
.bible-assistant-view .bible-conversation:has(.conversation-speech-preparing:not([hidden])) > .conversation-action-bar {
  flex: 0 0 auto !important;
  max-height: 32dvh;
  overflow-y: auto;
}
/* Only the workspace/transcript scrolls. The full frame cannot drift off
   screen during answer reading; the portrait owns a separate fixed grid row. */
.bible-assistant-view .bible-conversation:is(.question-answer-completed, .mobile-speaking-active) .bible-conversation__workspace,
.bible-assistant-view .bible-conversation:has(.conversation-log .conversation-message) .bible-conversation__workspace,
.bible-assistant-view .bible-conversation:has(.conversation-speech-preparing:not([hidden])) .bible-conversation__workspace {
  min-height: 0 !important;
  max-height: 100% !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
}
.bible-assistant-view .bible-conversation:is(.question-answer-completed, .mobile-speaking-active) .conversation-speech-preparing:not([hidden]),
.bible-assistant-view .bible-conversation:has(.conversation-log .conversation-message) .conversation-speech-preparing:not([hidden]),
.bible-assistant-view .bible-conversation:has(.conversation-speech-preparing:not([hidden])) .conversation-speech-preparing:not([hidden]) {
  order: -1 !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 6 !important;
  flex: 0 0 auto !important;
  margin: 0 .35rem .25rem !important;
  max-width: calc(100% - .7rem) !important;
}
@media (max-width: 850px) {
  .bible-assistant-view .bible-conversation:is(.question-answer-completed, .mobile-speaking-active) > .conversation-main,
  .bible-assistant-view .bible-conversation:has(.conversation-log .conversation-message) > .conversation-main,
  .bible-assistant-view .bible-conversation:has(.conversation-speech-preparing:not([hidden])) > .conversation-main {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: clamp(8.5rem, 24dvh, 13rem) minmax(0, 1fr) !important;
  }
  .bible-assistant-view .bible-conversation:is(.question-answer-completed, .mobile-speaking-active) .conversation-avatar-panel,
  .bible-assistant-view .bible-conversation:has(.conversation-log .conversation-message) .conversation-avatar-panel,
  .bible-assistant-view .bible-conversation:has(.conversation-speech-preparing:not([hidden])) .conversation-avatar-panel {
    position: relative !important;
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    flex: none !important;
    top: auto !important;
    overflow: hidden !important;
  }
  .bible-assistant-view .bible-conversation:is(.question-answer-completed, .mobile-speaking-active) .bible-conversation__workspace,
  .bible-assistant-view .bible-conversation:has(.conversation-log .conversation-message) .bible-conversation__workspace,
  .bible-assistant-view .bible-conversation:has(.conversation-speech-preparing:not([hidden])) .bible-conversation__workspace {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }
}
@media (max-width: 850px) and (max-height: 650px) {
  .bible-assistant-view .bible-conversation:is(.question-answer-completed, .mobile-speaking-active) > .conversation-main,
  .bible-assistant-view .bible-conversation:has(.conversation-log .conversation-message) > .conversation-main,
  .bible-assistant-view .bible-conversation:has(.conversation-speech-preparing:not([hidden])) > .conversation-main {
    grid-template-rows: clamp(7rem, 22dvh, 9rem) minmax(0, 1fr) !important;
  }
}
/* Draw arrows inside their actual target buttons while the guide is open.
   This guarantees correct button alignment without coordinate clamping. */
.bible-assistant-view .conversation-start-guide__targets {
  display: none !important;
}
.bible-assistant-view .bible-conversation:has(> .conversation-start-guide:not([hidden])) .conversation-action-bar .mic-button,
.bible-assistant-view .bible-conversation:has(> .conversation-start-guide:not([hidden])) .conversation-action-bar .type-instead-control {
  position: relative !important;
  padding-top: 1.55rem !important;
}
.bible-assistant-view .bible-conversation:has(> .conversation-start-guide:not([hidden])) .conversation-action-bar .mic-button::before,
.bible-assistant-view .bible-conversation:has(> .conversation-start-guide:not([hidden])) .conversation-action-bar .type-instead-control::before {
  content: "↓";
  position: absolute;
  left: 50%;
  top: .05rem;
  transform: translateX(-50%);
  font: 900 1.5rem/1 system-ui, sans-serif;
  color: #e31d36;
  text-shadow: 0 1px 0 #fff;
  pointer-events: none;
}

/* 2026-11-15: The preparing notice is now a direct child of the Sanctuary
   conversation, BETWEEN the non-scrolling portrait/workspace frame and
   action controls. It consumes its own flex row instead of covering text. */
.bible-assistant-view .bible-conversation > .conversation-speech-preparing:not([hidden]) {
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  bottom: auto !important;
  order: 0 !important;
  z-index: 1 !important;
  box-sizing: border-box !important;
  display: block !important;
  flex: 0 0 auto !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 .35rem .25rem !important;
  padding: .4rem .65rem !important;
  line-height: 1.2 !important;
  box-shadow: none !important;
}
.bible-assistant-view .bible-conversation > .conversation-speech-preparing[hidden] {
  display: none !important;
}
@media (max-width: 360px) and (max-height: 650px) {
  /* Reclaim a little portrait height for readable transcript lines on
     short phones when preparation is visible. The image still has a
     dedicated, unobstructed region and never overlays the answer. */
  .bible-assistant-view .bible-conversation:has(> .conversation-speech-preparing:not([hidden])) > .conversation-main {
    grid-template-rows: 7rem minmax(0, 1fr) !important;
  }
}

/* Preserve readable answer lines on short phones while the action bar
   retains its own scrolling area. Keep the portrait and preparing row intact. */
@media (max-width: 360px) and (max-height: 650px) {
  .bible-assistant-view .bible-conversation:is(.question-answer-completed, .mobile-speaking-active) > .conversation-action-bar,
  .bible-assistant-view .bible-conversation:has(.conversation-log .conversation-message) > .conversation-action-bar,
  .bible-assistant-view .bible-conversation:has(.conversation-speech-preparing:not([hidden])) > .conversation-action-bar {
    max-height: 22dvh !important;
  }
}

/* 2026-11-25: Packages-first dialog and compact empty Sanctuary.
   Keep package choices above the single-question offer on every viewport, and
   release the reserved transcript height before a visitor asks a question. */
.bible-assistant-view .question-choice-options {
  grid-template-columns: minmax(0, 1.85fr) minmax(240px, .95fr);
}

/* Before the first question, the empty workspace must size to its content.
   This keeps Tap to Speak, Type Instead, language, and voice controls directly
   beneath the composer instead of below a viewport-sized blank area. */
.bible-assistant-view .conversation-main:has(.conversation-empty:not([hidden])),
.bible-assistant-view .conversation-main:has(.conversation-empty:not([hidden])) .bible-conversation__workspace {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
}
.bible-assistant-view .conversation-main:has(.conversation-empty:not([hidden])) .bible-conversation__workspace {
  flex: 0 0 auto !important;
}

@media (max-width: 850px) {
  .bible-assistant-view .conversation-main:has(.conversation-empty:not([hidden])) {
    grid-template-rows: var(--sanctuary-visible-avatar-height) auto !important;
  }
}

@media (max-width: 760px) {
  .bible-assistant-view .question-choice-options {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* 2026-11-25 follow-up: make empty-state compaction self-contained.
   Cloudflare can retain an older site.css, so the newly versioned responsive
   sheet owns the empty-history removal on every device. */
.bible-assistant-view .bible-conversation__workspace:has(.conversation-empty:not([hidden])) .conversation-toolbar,
.bible-assistant-view .bible-conversation__workspace:has(.conversation-empty:not([hidden])) .conversation-history {
  display: none !important;
}

/* On wide screens, keep the initial portrait readable without letting its
   unused row push the controls below the viewport. This applies only before
   the first question; answer-reading and speaking layouts are unchanged. */
@media (min-width: 851px) {
  /* site.css gives the empty conversation a viewport-filling first grid row.
     Collapse that outer row as well as the inner workspace so the guide and
     complete control bar sit directly below the initial portrait/composer. */
  .bible-assistant-view .bible-conversation:has(.conversation-empty:not([hidden])) {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    grid-template-rows: auto auto auto !important;
    grid-auto-rows: auto !important;
    align-content: start !important;
  }
  .bible-assistant-view .conversation-main:has(.conversation-empty:not([hidden])) {
    height: clamp(16rem, 42dvh, 24rem) !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }
  .bible-assistant-view .conversation-main:has(.conversation-empty:not([hidden])) .conversation-avatar-panel {
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
  }
}


/* Compact only the empty layouts that overflow short phones/tablet portrait.
   Completed questions and active answer-reading keep their existing geometry. */
@media (max-width: 389px) and (max-height: 700px) {
  .bible-assistant-view .bible-conversation:has(.conversation-empty:not([hidden])) {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    grid-template-rows: auto auto auto !important;
    grid-auto-rows: auto !important;
    align-content: start !important;
  }
  .bible-assistant-view .conversation-main:has(.conversation-empty:not([hidden])) {
    display: grid !important;
    grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr) !important;
    grid-template-rows: minmax(0, 1fr) !important;
    height: 9.5rem !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }
  .bible-assistant-view .conversation-main:has(.conversation-empty:not([hidden])) .conversation-avatar-panel {
    grid-column: 1 !important;
    grid-row: 1 !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    flex: none !important;
  }
  .bible-assistant-view .conversation-main:has(.conversation-empty:not([hidden])) .special-bible-avatar figcaption {
    display: none !important;
  }
  .bible-assistant-view .conversation-main:has(.conversation-empty:not([hidden])) .bible-conversation__workspace {
    grid-column: 2 !important;
    grid-row: 1 !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    overflow-y: auto !important;
  }
}
@media (max-width: 340px) and (max-height: 620px) {
  .bible-assistant-view .conversation-main:has(.conversation-empty:not([hidden])) {
    height: 7.75rem !important;
  }
  .bible-assistant-view .bible-conversation:has(.conversation-empty:not([hidden])) > .conversation-start-guide:not([hidden]) {
    padding: .22rem .4rem !important;
  }
  .bible-assistant-view .bible-conversation:has(.conversation-empty:not([hidden])) .conversation-start-guide__content {
    font-size: .68rem !important;
    line-height: 1.15 !important;
  }
  .bible-assistant-view .bible-conversation:has(.conversation-empty:not([hidden])) .conversation-start-guide__content strong {
    font-size: .75rem !important;
  }
  .bible-assistant-view .bible-conversation:has(.conversation-empty:not([hidden])) .conversation-action-bar .mic-button,
  .bible-assistant-view .bible-conversation:has(.conversation-empty:not([hidden])) .conversation-action-bar .type-instead-control {
    min-height: 3.25rem !important;
    padding: 1.25rem .25rem .25rem !important;
    font-size: .8rem !important;
  }
  .bible-assistant-view .bible-conversation:has(.conversation-empty:not([hidden])) .language-control,
  .bible-assistant-view .bible-conversation:has(.conversation-empty:not([hidden])) .conversation-controls {
    padding: .2rem !important;
    min-height: 0 !important;
    gap: .1rem !important;
  }
  .bible-assistant-view .bible-conversation:has(.conversation-empty:not([hidden])) .ask-language-selector {
    gap: .15rem !important;
  }
  .bible-assistant-view .bible-conversation:has(.conversation-empty:not([hidden])) .ask-language-selector button {
    padding: .25rem !important;
    min-width: 0 !important;
    min-height: 2rem !important;
    font-size: .7rem !important;
  }
  .bible-assistant-view .bible-conversation:has(.conversation-empty:not([hidden])) .voice-response-toggle {
    gap: .25rem !important;
    font-size: .72rem !important;
  }
  .bible-assistant-view .bible-conversation:has(.conversation-empty:not([hidden])) .voice-response-toggle__track {
    width: 2rem !important;
    height: 1.25rem !important;
    flex: 0 0 2rem !important;
  }
  .bible-assistant-view .bible-conversation:has(.conversation-empty:not([hidden])) .voice-response-toggle {
    grid-template-columns: 2rem minmax(0, 1fr) !important;
  }
  .bible-assistant-view .bible-conversation:has(.conversation-empty:not([hidden])) .voice-response-toggle__track > span {
    width: .875rem !important;
    height: .875rem !important;
  }
  .bible-assistant-view .bible-conversation:has(.conversation-empty:not([hidden])) .voice-response-toggle input:checked + .voice-response-toggle__track > span {
    transform: translateX(.75rem) !important;
  }
  .bible-assistant-view .bible-conversation:has(.conversation-empty:not([hidden])) .voice-response-toggle__copy strong {
    font-size: .7rem !important;
    line-height: 1.15 !important;
  }
  .bible-assistant-view .bible-conversation:has(.conversation-empty:not([hidden])) .conversation-end {
    min-height: 2.25rem !important;
    padding: .25rem !important;
    font-size: .8rem !important;
  }
}
@media (min-width: 761px) and (max-width: 850px) and (orientation: portrait) {
  .bible-assistant-view .bible-conversation:has(.conversation-empty:not([hidden])) {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    grid-template-rows: auto auto auto !important;
    grid-auto-rows: auto !important;
    align-content: start !important;
  }
}

/* Type Instead: bold empty-field prompt; all emphasis stays inside the box. */
.bible-assistant-view [data-conversation-input].typing-question-prompt {
  border-color: #8f1d2c !important;
  background: #fff4d8 !important;
  animation: type-question-prompt-pulse 1.4s ease-in-out infinite;
}
.bible-assistant-view [data-conversation-input].typing-question-prompt::placeholder {
  color: #173f32 !important;
  font-weight: 900;
  opacity: 1;
}
@keyframes type-question-prompt-pulse {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(143,29,44,.35); }
  50% { box-shadow: inset 0 0 0 4px rgba(143,29,44,.85); }
}
@media (prefers-reduced-motion: reduce) {
  .bible-assistant-view [data-conversation-input].typing-question-prompt {
    animation: none !important;
    box-shadow: inset 0 0 0 3px #8f1d2c;
  }
}
/* Keep answer-generation guidance bold and noticeable without moving its row. */
.bible-assistant-view .conversation-status[data-state="processing"] {
  font-weight: 900;
  color: #173f32;
  background: #fff4d8;
  animation: answer-generation-status-pulse 1.4s ease-in-out infinite;
}
@keyframes answer-generation-status-pulse {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(143,29,44,.25); }
  50% { box-shadow: inset 0 0 0 4px rgba(143,29,44,.85); }
}
@media (prefers-reduced-motion: reduce) {
  .bible-assistant-view .conversation-status[data-state="processing"] {
    animation: none !important;
    box-shadow: inset 0 0 0 3px #8f1d2c;
  }
  .bible-assistant-view .conversation-status[data-state="processing"]::before { animation: none !important; }
}

/* The whole bold two-line instruction must fit on short, narrow phones. */
.bible-assistant-view [data-conversation-input].typing-entry-selected {
  box-sizing: border-box;
  height: 4.75rem !important;
  min-height: 4.75rem !important;
  line-height: 1.35;
}
