/* The selected graph path reads as one continuous conversation. */
body {
  background: radial-gradient(ellipse at 85% 10%, #e6dcf2 0, transparent 55%),
    radial-gradient(ellipse at 10% 95%, #dae7db 0, transparent 45%), #d5dcf7;
}
.chat-shell { width: min(580px, 100%); box-shadow: 0 24px 80px #4d497126; }
.conversation-scroll { position: relative; padding: 24px 20px; background-size: 320px; overflow-anchor: none; scroll-behavior: auto; }
.current { position: relative; }
.conversation-scroll:focus-visible { outline: 2px solid #bea6d0; outline-offset: -2px; }
.history { display: flex; flex-direction: column; gap: 24px; list-style: none; padding: 0; margin: 0 0 24px; }
.history:empty { display: none; }
.conversation-turn { min-width: 0; width: 100%; }
.history-question { display: flex; align-items: flex-start; gap: 9px; }
.history-question .chat-bubble { flex: 0 1 auto; max-width: calc(100% - 39px); }
.message-author { display: block; color: #987da9; font-size: 10px; line-height: 1.8; margin-bottom: 5px; }
.history-question p { font-size: 13px; line-height: 2; overflow-wrap: anywhere; }
.history-question .history-description { color: #8c8296; font-size: 11px; margin-top: 5px; }
.history-answer { display: flex; justify-content: flex-end; margin-top: 10px; padding-inline-start: 39px; }
.history-answer-bubble {
  min-width: 150px; max-width: 90%; padding: 10px 14px 12px;
  background: linear-gradient(135deg, #edf5e6, #e6f0dd); border: 1px solid #d8e5cd;
  color: #36512e; border-radius: 5px 17px 17px 17px; box-shadow: 0 3px 9px #354f3508;
}
.history-answer-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 4px; }
.history-answer-header .message-author { color: #78916a; margin: 0; }
.history-answer-bubble > p { font-size: 13px; line-height: 1.95; overflow-wrap: anywhere; }
.question-waiting { visibility: hidden; }
.graph-thinking { position: absolute; inset-block-start: 0; inset-inline-start: 0; display: flex; align-items: flex-start; gap: 9px; margin-bottom: 14px; }
.new-answer { animation: answer-arrive 240ms ease-out both; }
.question-content:not(.question-waiting) { animation: answer-arrive 220ms ease-out both; }
@keyframes answer-arrive { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.thinking-bubble {
  display: flex; align-items: center; gap: 13px; padding: 12px 16px;
  border: 1px solid #e3daeb; border-radius: 15px 4px 15px 15px;
  background: #fdfcfe; color: #8b719c; font-size: 12px;
}
.thinking-dots { display: inline-flex; align-items: center; gap: 4px; }
.thinking-dots span { width: 4px; height: 4px; background: #ae91c1; border-radius: 50%; animation: thinking-pulse .8s ease-in-out infinite alternate; }
.thinking-dots span:nth-child(2) { animation-delay: .15s; }
.thinking-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes thinking-pulse { from { opacity: .25; } to { opacity: 1; } }
.answer-choices { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 6px 0 0; padding: 0; }
.answer-choices li { padding: 3px 9px; border-radius: 8px; background: #ffffff80; border: 1px solid #d6e3cc; font-size: 12px; overflow-wrap: anywhere; }
.question-heading > div { padding: 13px 16px; }
.question-heading h2 { font-size: 15px; }
.option-list { gap: 9px; }
.option-button { font-size: 13px; min-height: 47px; transition: background .15s, border-color .15s; }
.option-button.previous-answer { border-color: #9c7ab8; background: #eee5f7; color: var(--purple-dark); }
.editing-notice {
  margin-bottom: 16px; padding: 11px 14px; border: 1px solid #dfcfee;
  border-inline-start: 3px solid var(--purple); border-radius: 12px; background: #f4edf9;
}
.editing-notice strong { color: var(--purple); font-size: 12px; }
.editing-notice p { margin-top: 3px; color: #84718f; font-size: 11px; }
.chat-controls { flex-wrap: wrap; padding-block: 9px; gap: 4px 10px; }
.chat-controls .text-button { font-size: 11px; min-height: 30px; }
.answer-count { color: #a497ad; font-size: 10px; margin-inline-start: auto; }
.chat-controls .jump-latest { color: var(--purple); background: #f1e9f8; padding-inline: 10px; }
@media (max-width: 600px) {
  .chat-shell { width: 100%; }
  .conversation-scroll { padding: 20px 12px; }
  .history { gap: 20px; }
  .history-question .chat-bubble { padding: 11px 13px; }
  .history-answer { padding-inline-start: 30px; }
  .history-answer-bubble { max-width: 95%; }
  .chat-controls .text-button { min-height: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .option-button { transition: none; }
  .thinking-dots span { animation: none; }
  .new-answer, .question-content:not(.question-waiting) { animation: none; }
}
