/* Chat-specific layout; account and administrator pages retain their own layout. */
.history-sidebar { position: fixed; top: 90px; left: 16px; bottom: 16px; width: 232px; padding: 16px; overflow-y: auto; background: #eaf0ec; border: 1px solid #dce6df; border-radius: 14px; }
.history-sidebar p { font-size: 12px; color: #53685c; }
.history-sidebar button { min-height: 40px; }
#historyToggle { width: 100%; text-align: left; background: transparent; color: #244c3c; margin-bottom: 12px; }
.history-date { margin: 20px 0 6px; font-weight: 600; }
.history-item { padding: 8px; margin-bottom: 6px; border-radius: 8px; background: #ffffffa0; }
.history-item button { background: transparent; color: #426451; font-size: 12px; padding: 5px; }
.history-item .history-open { display: block; width: 100%; text-align: left; overflow-wrap: anywhere; font-size: 14px; }
.history-open[aria-current=true] { font-weight: 750; color: #075640; }
.chat-page main { width: calc(100% - 280px); margin-left: max(264px, calc((100% - 560px) / 2)); margin-right: 16px; }
#conversationMessages { order: 1; display: grid; gap: 14px; }
#conversationMessages[hidden] { display: none; }
.conversation-turn { padding: 20px; background: #fff; border: 1px solid #dfe7e3; border-radius: 14px; overflow-wrap: anywhere; }
.conversation-turn h2 { font-size: 16px; }
.conversation-turn p { white-space: pre-wrap; margin: 16px 0; }
.conversation-turn button { padding: 8px 12px; background: #edf4ef; color: #315b4d; font-size: 13px; }
@media (max-width: 1100px) {
  .history-sidebar { position: static; width: auto; margin: 16px 14px 0; padding: 12px; }
  #historyToggle { margin: 0; }
  #historyContent { display: none; }
  .history-sidebar.is-open #historyContent { display: block; max-height: 50vh; overflow-y: auto; }
  .chat-page main { width: 100%; margin: 0 auto; }
}
.chat-page {
  background: #f3f6f5;
  font-family: "Segoe UI", Arial, sans-serif;
}
.chat-page .navbar { max-width: 1040px; }
.chat-page main { max-width: 820px; }
.chat-page .app-shell {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
  padding: 36px 24px 20px;
}
.chat-page .intro-panel {
  order: 0;
  min-height: auto;
  padding: 0 4px 8px;
  background: none;
  border: 0;
  box-shadow: none;
}
.chat-page .eyebrow { color: #47776a; font-size: 11px; letter-spacing: .12em; }
.chat-page h1 { font-size: clamp(27px, 4vw, 36px); line-height: 1.25; font-weight: 650; margin-bottom: 10px; letter-spacing: -.025em; }
.chat-page .intro-text { max-width: 660px; margin: 0; font-size: 15px; line-height: 1.7; }
.chat-page .chat-panel, .chat-page .answer-panel {
  padding: 24px;
  border-radius: 16px;
  border-color: #dfe7e3;
  box-shadow: 0 3px 14px #153b2d05;
}
.chat-page .chat-panel { order: 2; }
.chat-page .answer-panel { order: 3; }
.chat-page h2 { font-size: 19px; font-weight: 650; color: #203e34; }
.chat-page .panel-heading { margin-bottom: 18px; }
.chat-page .panel-heading p { font-size: 14px; margin-top: 6px; }
.chat-page .question-form { gap: 12px; }
.chat-page .question-form > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.chat-page textarea { min-height: 110px; font-size: 16px; border-radius: 10px; background: #fcfdfc; }
.chat-page button { font-weight: 600; border-radius: 9px; }
.chat-page .question-form > .action-row { grid-template-columns: 1fr; }
.chat-page .question-form > .action-row-secondary { display: flex; justify-content: space-between; gap: 12px; }
.chat-page .action-row-secondary button { width: auto; padding: 8px 12px; }
.chat-page .secondary-action { background: #f4f7f5; color: #315b4d; border-color: #dce6e0; font-size: 14px; }
.chat-page .secondary-action:hover:not(:disabled) { background: #e8f1ec; border-color: #a9c6b7; }
.chat-page .sample-questions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 14px; border-top: 1px solid #edf1ee; }
.chat-page .sample-button { min-height: 40px; padding: 8px 12px; border-radius: 20px; background: white; border-color: #d9e5de; font-size: 13px; font-weight: 500; }
.chat-page .sample-button:hover { background: #edf5f0; }
.chat-page .form-message:empty { display: none; }
.chat-page .form-message { margin: 0; font-size: 14px; }
.chat-page .answer-card { min-height: 96px; background: #f6f9f7; border: 0; padding: 18px; border-radius: 10px; }
.chat-page .answer-card p { font-size: 16px; line-height: 1.8; }
.chat-page .answer-playback { display: flex; margin-top: 12px; }
.chat-page .answer-playback button { width: auto; min-width: 110px; }
.chat-page .feedback-actions { border-top: 1px solid #edf1ee; padding-top: 16px; margin-top: 18px; }
.chat-page .feedback-actions button { background: white; font-size: 13px; padding: 10px; }
.chat-page .feedback-access-hint { font-size: 13px; line-height: 1.6; margin: 10px 0 0; color: #63756b; }
.chat-page .site-footer { font-size: 12px; padding: 16px 20px 28px; color: #718077; }
@media (max-width: 559px) {
  .chat-page .app-shell { padding: 24px 14px 12px; gap: 14px; }
  .chat-page .chat-panel, .chat-page .answer-panel { padding: 18px; border-radius: 12px; }
  .chat-page .intro-text { font-size: 14px; }
  .chat-page .feedback-actions { grid-template-columns: 1fr; gap: 8px; }
  .chat-page .sample-questions { gap: 6px; }
}

/* Source titles remain readable on narrow screens and separate from the answer. */
.answer-sources { margin: 1rem 0; padding: 1rem; background: #f1f7f4; border-left: 3px solid #0b705f; border-radius: 6px; overflow-wrap: anywhere; }
.answer-sources[hidden] { display: none; }
.answer-sources h3 { margin: 0 0 .35rem; font-size: 1rem; }
.answer-sources .source-note { margin: 0 0 .5rem; font-size: .85rem; color: #496159; }
.answer-sources ul { margin: 0; padding-left: 1.25rem; }
.answer-sources li + li { margin-top: .35rem; }

.answer-citation { color: #075e50; font-weight: 700; margin-inline: .15em; text-decoration: underline; }
.answer-sources li:target, .answer-sources li:focus { outline: 2px solid #0b705f; outline-offset: 3px; background: #dceee6; }
