/* Small additions on top of Tabler. */
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--tblr-border-radius);
  background: var(--tblr-primary);
  color: #fff;
  font-weight: 700;
  font-size: .8rem;
}

/* Chat */
/* The history list and the chat are the same height and each scrolls on its own, so neither pushes the page. */
.chat-card, .chat-side { height: calc(100vh - 12rem); min-height: 30rem; display: flex; flex-direction: column; }
.chat-thread { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: .75rem; }
.chat-side .chat-history { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
@media (max-width: 991.98px) {       /* stacked: history is a short strip above the chat */
  .chat-side { height: auto; min-height: 0; max-height: 18rem; }
}
.chat-msg { display: flex; }
.chat-msg-user { justify-content: flex-end; }
.chat-bubble { max-width: min(46rem, 88%); padding: .6rem .85rem; border-radius: var(--tblr-border-radius-lg);
               background: var(--tblr-bg-surface-secondary); }
.chat-msg-user .chat-bubble { background: var(--tblr-primary); color: #fff; }
.chat-citations { margin-top: .5rem; }
.chat-citations .badge { white-space: normal; text-align: left; font-weight: 400; }
.chat-thinking .chat-text::after { content: " ●"; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }

/* Policy library: the clause a citation links to is highlighted */
.policy-section { scroll-margin-top: 1rem; padding: .75rem 1rem; margin: 0 -1rem .5rem; border-radius: var(--tblr-border-radius); }
.policy-section:target { background: rgba(var(--tblr-primary-rgb), .08); box-shadow: inset 3px 0 0 var(--tblr-primary); }
.policy-text table { width: 100%; margin-bottom: 1rem; font-size: .875rem; }
.policy-text th, .policy-text td { border-bottom: 1px solid var(--tblr-border-color); padding: .35rem .5rem; text-align: left; }
.chat-citations a.badge { text-decoration: none; }
.chat-citations a.badge:hover { background: rgba(var(--tblr-primary-rgb), .15) !important; }

/* Streaming: what the agent is doing, under the text it has written so far */
.chat-status { margin-top: .25rem; font-style: italic; }
.chat-thinking .chat-text:empty { display: none; }
