.source-toggle {
  display: inline-block;
}

.message.assistant {
  white-space: normal;
}

.message.assistant.is-loading {
  color: #477064;
  font-style: italic;
}

.message.assistant.is-loading::after {
  animation: answer-pulse 1s steps(3, end) infinite;
  content: " ···";
  display: inline-block;
  font-style: normal;
  overflow: hidden;
  vertical-align: bottom;
  width: 1.45rem;
}

@keyframes answer-pulse {
  from { opacity: 0.25; }
  50% { opacity: 1; }
  to { opacity: 0.25; }
}

.message.assistant p {
  margin: 0 0 0.9rem;
}

.message.assistant h3,
.message.assistant h4 {
  color: #075647;
  line-height: 1.25;
  margin: 0 0 0.7rem;
}

.message.assistant h3 {
  font-size: 1.05rem;
}

.message.assistant h4 {
  font-size: 0.98rem;
}

.message.assistant ul,
.message.assistant ol {
  margin: 0.3rem 0 1rem;
  padding-left: 1.35rem;
}

.message.assistant li {
  margin: 0.38rem 0;
  padding-left: 0.12rem;
}

.message.assistant strong {
  color: #0a4c3f;
  font-weight: 800;
}

.message.assistant code {
  background: #edf3ee;
  border-radius: 0.25rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  padding: 0.12rem 0.3rem;
}

.answer-citation {
  background: #e5f1dc;
  border-radius: 999px;
  color: #175d4b;
  font-size: 0.78em;
  font-weight: 800;
  padding: 0.12rem 0.42rem;
  white-space: nowrap;
}

.answer-table-wrap {
  border: 1px solid #d4dfd5;
  border-radius: 0.6rem;
  margin: 0.9rem 0 1.1rem;
  overflow-x: auto;
}

.answer-table-wrap table {
  border-collapse: collapse;
  min-width: 100%;
  width: max-content;
}

.answer-table-wrap th,
.answer-table-wrap td {
  border-bottom: 1px solid #dce5de;
  padding: 0.62rem 0.72rem;
  text-align: left;
  vertical-align: top;
}

.answer-table-wrap th {
  background: #e7f0e7;
  color: #075647;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.answer-table-wrap tr:last-child td {
  border-bottom: 0;
}

.source-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.8rem;
}

.source-actions a,
.page-pdf-link {
  color: #006b58;
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.25;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.source-actions .catalog-link {
  color: #547269;
  font-weight: 600;
}

.page-pdf-link {
  background: #f8fbf8;
  border-radius: 0.35rem;
  left: 1.2rem;
  padding: 0.45rem 0.6rem;
  position: absolute;
  top: 1.2rem;
}

@media (min-width: 1001px) {
  .chat-shell:has(.source-panel.hidden) {
    grid-template-columns: 270px minmax(460px, 1fr);
  }
}
