/* Ana Avda's conversation on /ask (ask/show): the header and composer frame
   a single scrolling thread, filling the window under the top nav. */
.ana-avda-panel {
  height: max(0px, calc(var(--chat-viewport-height, 100dvh) - var(--chat-panel-offset, 3rem)));
  min-height: 0;
  container-type: inline-size;
}
@media (max-width: 639px) {
  /* Initial/no-JS sizing includes the phone's second navigation row. The
     controller replaces this with the panel's measured visual-viewport offset. */
  .ana-avda-panel { --chat-panel-offset: 5.5rem; }
}
.ana-avda-panel[data-full] {
  position: fixed;
  inset: 0;
  z-index: 60;
  top: var(--chat-viewport-top, 0px);
  bottom: auto;
  height: var(--chat-viewport-height, 100dvh);
  min-height: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
}
.ana-avda-panel[data-full] .ana-avda-composer > * {
  max-width: 76rem;
}
.ana-avda-turns {
  container-type: inline-size;
  scroll-behavior: smooth;
  scroll-padding-block: 1rem;
}
.ana-avda-turns > section {
  max-width: 76rem;
  margin-inline: auto;
  scroll-margin-top: 1rem;
}
@container (max-width: 28rem) {
  [data-chat-control-label], [data-ana-avda-chat-target="count"] { display: none; }
}
/* Source columns respond to the conversation's width. */
@container (max-width: 52rem) {
  [data-seforim-answer-target="layout"] { grid-template-columns: minmax(0, 1fr); }
  [data-seforim-answer-target="sources"] { position: static; max-height: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ana-avda-turns { scroll-behavior: auto; }
}
