/* Copied from usgbc-chatbot-perform chatbots/shared/static/css/style.css (2026-10-02). GALE-only rules removed;
   accent colour is var(--chat-accent), set per bot from ChatUIConfig.theme. */
:root { --chat-accent: #008ea6; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #ffffff;
  overflow: hidden;
}

.chat-container {
  background: white;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: opacity 0.4s ease-in-out;
}

.chat-window-wrapper {
  display: flex;
  justify-content: center;
  overflow-y: auto;
  flex-grow: 1;
}

.chat-window {
  padding: 1.5rem;
  height: fit-content;
  padding-bottom: 1rem;

  width: 100%;
  max-width: 850px;
  margin: 0 auto;
}

.chat-header {
  text-align: center;
  margin-bottom: 2rem;
}

.chat-header img {
  width: 60px;
}

.chat-header h2 {
  margin-top: 1rem;
  font-weight: 600;
  color: #444;
}

.chat-header p {
  margin-top: 1rem;
  color: #444;
  font-size: 0.95rem;
  line-height: 1.6;
  padding: 0 12rem;
}

.message-wrapper {
  display: flex;
  margin-bottom: 1rem;
  width: 100%;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-right: 12px;
  flex-shrink: 0;
}

.message {
  padding: 0.75rem 1.25rem;
  border-radius: 18px;
  max-width: 80%;
  line-height: 1.6;
  overflow-wrap: break-word;
}

.user-message {
  background-color: rgba(0, 142, 166, 0.1);
  color: rgb(39, 39, 42);
  border-bottom-right-radius: 5px;
}

.assistant-message {
  color: rgb(55, 65, 81);
  border-bottom-left-radius: 5px;
  padding-top: 0;
  padding-left: 0.25rem;
}

.assistant-message table {
  width: 100%;
}

.message-wrapper.user { justify-content: flex-end; }
.message-wrapper.assistant {
  justify-content: flex-start;
  padding-top: 0.75rem;
}
.message .content { margin: 0; }
.message .content p:last-child { margin-bottom: 0; }
.metadata { display: none; }

.thinking-indicator {
  display: flex;
  align-items: center;
  padding: 10px 0;
}

.thinking-indicator .dot-spinner {
  width: 8px;
  height: 8px;
  background-color: #a0a0a0;
  border-radius: 50%;
  margin: 0 4px;
  animation: bounce 1.4s infinite ease-in-out both;
}
.thinking-indicator .dot-spinner:nth-child(1) { animation-delay: -0.32s; }
.thinking-indicator .dot-spinner:nth-child(2) { animation-delay: -0.16s; }

.input-area-wrapper {
  flex-shrink: 0;
  background-color: #fff;
}

.input-area {
  display: flex;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
}

.input-area-content {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;

  width: 100%;
  max-width: 850px;
  border-top: 1px solid #e0e0e0;
  padding: 0.5rem 1rem;
}

.input-wrapper {
  flex-grow: 1;
  display: flex;
  align-items: flex-end;
  border: 1px solid #ccc;
  border-radius: 10px;
  padding: 0.1rem 0.1rem 0.1rem 0.5rem;
}

.input-wrapper:focus-within {
  border-color: var(--chat-accent);
  background-color: #ffffff;
}

#chat-input {
  flex-grow: 1;
  border: none;
  background: transparent;
  padding: 0.5rem 0.5rem;
  resize: none;
  outline: none;
  box-shadow: none;
  font-size: 1rem;
  line-height: 1.5;
  max-height: calc(1.5em * 8 + 1rem); /* max 8 lines */
  overflow-y: auto;
}

.icon-button {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background-color: transparent;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s;
}

.icon-button:hover {
  background-color: #e9ecef;
}

.icon-button.send {
  background-color:  var(--chat-accent);
  color: white;
  border-radius: 25%;
  width: 32px;
  height: 32px;
  margin-right: 3px;
  margin-bottom: 3px;
}
.icon-button.send:hover {
  background-color: #006c7f;
}
.icon-button:disabled {
  background-color: #a0a0a0;
  cursor: not-allowed;
  opacity: 0.7;
}

.icon-button .icon {
  width: 16px;
  height: 16px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
  display: none;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1.0); }
}



#user-info-form-wrapper {
  padding: 0 5rem;
}
.user-info-form {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}
.user-info-form .form-title {
  font-weight: 600;
  color: #333;
  margin-bottom: 1rem;
}
.user-info-form .form-group {
  margin-bottom: 1rem;
}
.user-info-form .form-buttons {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}
.user-info-form .btn-primary {
  background-color: #007bff;
  border-color: #007bff;
}
.user-info-form .btn-secondary {
  background-color: #6c757d;
  border-color: #6c757d;
}


.feedback-inline-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e9ecef;
}

.feedback-button-group {
  display: flex;
  align-items: center;
}

.feedback-inline-text {
  font-size: 0.9rem;
  color: #555;
  margin: 0;
}

.feedback-inline-button {
  background: none;
  border: none;
  cursor: pointer;
  color: #777;
  padding: 0.25rem;
  border-radius: 25%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, color 0.2s;
}

.feedback-inline-button svg {
  width: 20px;
  height: 20px;
}

.feedback-inline-button:hover {
  background-color: #f0f0f0;
}

.feedback-inline-button:disabled {
  cursor: not-allowed;
  color: var(--chat-accent);
}





#user-info-container {
  padding: 0 1rem;
  margin-bottom: 1rem;
}

.user-info-display {
  background-color: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  color: #333;
  font-size: 0.95rem;
  max-width: 500px;
  margin: 0 auto;
  margin-bottom: 1rem;
}

.user-info-display summary {
  padding: 0.75rem 1rem;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-info-display summary::-webkit-details-marker {
  display: none;
}

.user-info-display summary::after {
  content: '▴';
  font-size: 1.2em;
  transition: transform 0.2s;
}

.user-info-display details:not([open]) > summary::after {
  transform: rotate(180deg);
}

.user-info-display .user-info-content {
  padding: 0 1rem 1rem 1rem;
  border-top: 1px solid #4a4a4a;
}

.user-info-display .user-info-content p {
  margin: 0.5rem 0;
}

.user-info-display .user-info-content strong {
  color: #000;
}

.user-info-display .user-info-content a {
  color: #2783ec;
  text-decoration: none;
}

.user-info-display .user-info-content a:hover {
  text-decoration: underline;
}


.in-chat-follow-ups {
  margin: 0 0 1rem 50px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.in-chat-follow-ups h4 {
  font-size: 0.95rem;
  color: rgb(17, 19, 21);
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.follow-up-question {
  color: rgb(17, 19, 21);
  cursor: pointer;
  background-color: transparent;
  border: none;
  text-align: left;
  padding: 0;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.follow-up-question:hover {
  color: #000;
}

.follow-up-question svg {
  width: 16px;
  height: 16px;
  color: rgb(17, 19, 21);
  flex-shrink: 0;
  margin-right: 4px;
  margin-top: -4px;
}




.icon-button.recording {
  color: #dc3545;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
  }
}


.top-bar {
  display: flex; /* will be toggled from none */
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
  justify-content: center;
  padding: 0;
}

.top-bar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 850px;
  border-bottom: 1px solid #e0e0e0;
  padding: 0.75rem 1.5rem;
}

.top-bar-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
}

.top-bar-actions {
  display: flex;
  gap: 0.5rem;
}

.logo-big {
  overflow: hidden;
  display: inline-block;
  border-radius: 100%;
}

.logo-big img {
  width: 80px;
  height: 80px;
  -o-object-fit: cover;
  object-fit: cover;
}

button.btn {
  font-size: 14px;
}

#submit-user-info {
  border: rgb(229, 231, 235);
  background: rgb(0, 142, 166);
  color: white;
  padding: 9px 18px;
  border-radius: 10px;
}

#submit-user-info:hover {
  background: rgb(0, 123, 139);
}

#submit-user-info:active {
  scale: 0.97;
  padding-top: 8px;
  padding-bottom: 10px;
}

#skip-user-info {
  border: 0;
  box-shadow: none;
}

#skip-user-info:hover {
  background: rgb(238, 238, 238);
}

.user-info-form .form-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

ol ol, ol ul, ul ol, ul ul {
  margin-bottom: 1rem;
}

.assistant-message .content table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  table-layout: fixed;
}

.assistant-message .content table thead {
  background-color: #f8f9fa;
}

.assistant-message .content table th {
  padding: 12px 15px;
  font-weight: 600;
  text-align: left;
  color: #495057;
  border-right: 1px solid #e0e0e0;
  border-bottom: 1px solid #e0e0e0;
}

.assistant-message .content table td {
  padding: 12px 15px;
  color: #333;
  border-right: 1px solid #e0e0e0;
  border-bottom: 1px solid #e0e0e0;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-all;
}

.assistant-message .content table th:last-child,
.assistant-message .content table td:last-child {
  width: 6rem;
}

.assistant-message .content table tr:last-child td {
  border-bottom: 0;
}

.assistant-message .content table td:last-child,
.assistant-message .content table th:last-child {
  border-right: none;
}

.assistant-message .content table tr:first-child th:first-child {
  border-top-left-radius: 8px;
}
.assistant-message .content table tr:first-child th:last-child {
  border-top-right-radius: 8px;
}
.assistant-message .content table tr:last-child td:first-child {
  border-bottom-left-radius: 8px;
}
.assistant-message .content table tr:last-child td:last-child {
  border-bottom-right-radius: 8px;
}


.assistant-message .content > hr:last-child {
  display: none;
}

.assistant-message .content h1,
.assistant-message .content h2,
.assistant-message .content h3,
.assistant-message .content h4,
.assistant-message .content h5,
.assistant-message .content h6 {
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: #2c3136;
}

.assistant-message .content h1 {
  font-size: 1.5rem;
}

.assistant-message .content h2 {
  font-size: 1.25rem;
}

.assistant-message .content h3 {
  font-size: 1.15rem;
}

.assistant-message .content h4,
.assistant-message .content h5,
.assistant-message .content h6 {
  font-size: 1rem;
}

.icon-button svg {
  flex-shrink: 0;
}

#mic-button svg {
  width: 24px;
  height: 24px;
}





#scroll-to-bottom-btn {
  position: absolute;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  background-color: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  color: #555;
  transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out, transform 0.3s ease;

  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(10px);
}

#scroll-to-bottom-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

#scroll-to-bottom-btn:hover {
  background-color: #f8f9fa;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

#scroll-to-bottom-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  min-width: 20px;
  min-height: 20px;
}


/* =============================================== */
/* ============= FEEDBACK MODAL STYLES =========== */
/* =============================================== */

.feedback-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.feedback-modal-container {
  background-color: #fff;
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.feedback-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e0e0e0;
}

.feedback-modal-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.close-button {
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: #888;
}

.feedback-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}

.feedback-section {
  margin-bottom: 1.5rem;
}

.feedback-section-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.feedback-section-header label {
  font-weight: 600;
}

.feedback-modal-icon {
  width: 20px;
  height: 20px;
  margin-left: 8px;
  color: #555;
}

.collapsible-content {
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 0.75rem;
  background-color: #f9f9f9;
  height: 48px;
  overflow: hidden;
}

.collapsible-content p:last-child {
  margin-bottom: 0;
}

.feedback-section.expanded .collapsible-content {
  height: auto;

  max-height: 500px;
  overflow: auto;
}

.collapsible-content > :first-child {
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.feedback-section.expanded .collapsible-content > :first-child {
  overflow: visible;
  white-space: normal;
}

.feedback-section:not(.expanded) .collapsible-content > :first-child {
  height: 24px;
}


.toggle-content-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  margin-left: auto;
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
}

.toggle-content-btn .arrow-icon {
  width: 32px;
  height: 32px;
  fill: #555;
}

.feedback-section.expanded .toggle-content-btn .arrow-icon {
  transform: rotate(180deg);
}


.feedback-reason-section p {
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.checkbox-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.checkbox-group div {
  display: flex;
  align-items: center;
}

.checkbox-group input[type="checkbox"] {
  margin-right: 0.5rem;
}

#feedback-text {
  width: 100%;
  min-height: 80px;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  resize: vertical;
}

.feedback-modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #e0e0e0;
  text-align: right;
}

.btn-confirm {
  background-color: var(--chat-accent);
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
}
.btn-confirm:hover {
  background-color: #006c7f;
}




.citation-sup {
  font-size: 0.75em;
  vertical-align: super;
  line-height: 0;
  margin-left: 2px;
}

.assistant-message .content .assistant-sources-table {
border-collapse: separate;
border-spacing: 0;
width: 100%;
margin-top: 1.5rem;
font-size: 0.9rem;
border: 1px solid #e0e0e0;
border-radius: 8px;
overflow: hidden;
table-layout: fixed;
}

.assistant-message .content .assistant-sources-table thead {
background-color: #f8f9fa;
}

.assistant-message .content .assistant-sources-table th {
padding: 12px 15px;
font-weight: 600;
text-align: left;
color: #495057;
border-right: 1px solid #e0e0e0;
border-bottom: 1px solid #e0e0e0;
}

.assistant-message .content .assistant-sources-table td {
padding: 12px 15px;
color: #333;
border-right: 1px solid #e0e0e0;
border-bottom: 1px solid #e0e0e0;
overflow-wrap: break-word;
word-wrap: break-word;
}

.assistant-message .content .assistant-sources-table th:last-child,
.assistant-message .content .assistant-sources-table td:last-child {
width: 6rem;
text-align: center;
border-right: none;
word-break: break-word;
}

.assistant-message .content .assistant-sources-table tr:last-child td {
border-bottom: 0;
}

/* .assistant-message .content .assistant-sources-table td:last-child,
.assistant-message .content .assistant-sources-table th:last-child {
border-right: none;
} */

.assistant-message .content .assistant-sources-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0 0;
  font-size: 0.9rem;
}

.assistant-message .content .assistant-sources-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid #e0e0e0;
  color: #333;
}

.assistant-message .content .assistant-sources-list li:last-child {
  border-bottom: none;
}

.assistant-message .content .assistant-sources-list li a {
  color: #007bff;
  text-decoration: none;
}

.assistant-message .content .assistant-sources-list li a:hover {
  text-decoration: underline;
}


/* =============================================== */
/* ============ DEBUG PANEL STYLES =============== */
/* =============================================== */

.message-wrapper.assistant .message {
  position: relative;
}

.debug-toggle-btn {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid #d0d0d0;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform 0.2s, background-color 0.2s;
  color: #888;
}

.debug-toggle-btn:hover {
  background-color: #f0f0f0;
  color: #555;
}

.debug-toggle-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.debug-toggle-btn.debug-toggle-expanded svg {
  transform: rotate(180deg);
}

.debug-panel {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background-color: #fafafa;
  max-height: 600px;
  overflow-y: auto;
  margin-top: 0.75rem;
  padding: 0.75rem;
  font-size: 0.85rem;
}

.debug-query-section {
  margin-bottom: 1rem;
}

.debug-query-section:last-child {
  margin-bottom: 0;
}

.debug-query-title {
  font-weight: 600;
  color: #333;
  margin-bottom: 0.25rem;
}

.debug-query-count {
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 0.5rem;
}

.debug-chunk-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
}

.debug-chunk-card:last-child {
  margin-bottom: 0;
}

.debug-chunk-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.debug-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.debug-badge-cited {
  background-color: #d4edda;
  color: #155724;
}

.debug-badge-unused {
  background-color: #f8d7da;
  color: #721c24;
}

.debug-doc-id {
  font-family: monospace;
  font-size: 0.8rem;
  color: #555;
}

.debug-score {
  margin-left: auto;
  font-size: 0.8rem;
  color: #888;
  white-space: nowrap;
}

.debug-chunk-details {
  margin-top: 0.4rem;
}

.debug-chunk-details summary {
  cursor: pointer;
  font-size: 0.8rem;
  color: #555;
  user-select: none;
}

.debug-chunk-details summary:hover {
  color: #333;
}

.debug-meta-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.25rem;
  font-size: 0.8rem;
}

.debug-meta-table td {
  padding: 2px 6px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: top;
}

.debug-meta-key {
  font-weight: 600;
  width: 30%;
  color: #444;
  white-space: nowrap;
}

.debug-chunk-content {
  margin: 0.25rem 0 0 0;
  padding: 0.5rem;
  background: #f8f9fa;
  border: 1px solid #eee;
  border-radius: 4px;
  font-size: 0.78rem;
  font-family: monospace;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 200px;
  overflow-y: auto;
}

/* =============================================== */
/* =========== MOBILE RESPONSIVE STYLES ========== */
/* =============================================== */

@media (max-width: 768px) {
  .chat-header p {
    padding: 0 1rem;
    font-size: 0.9rem;
  }

  .chat-window {
    padding: 1rem;
  }

  .user-info-form {
    width: 100%;
    padding: 1rem;
  }

  .message {
    max-width: 90%;
  }

  .in-chat-follow-ups {
    margin: 0 0 1rem 0;
    padding: 0 1rem;
  }

  #user-info-form-wrapper {
    padding: 0;
  }

  /* .message.assistant-message table {
    margin-left: -48px;
    width: calc(100% + 32px + 12px + 0.25rem + 1.25rem);
  } */
  .assistant-message .content .assistant-sources-table {
    margin-left: -48px;
    width: calc(100% + 32px + 12px + 0.25rem + 1.25rem);
  }

  .assistant-message .content .assistant-sources-list {
    margin-left: -48px;
    width: calc(100% + 32px + 12px + 0.25rem + 1.25rem);
  }

  .top-bar-actions .icon-button {
    width: 32px;
    height: 32px;
  }

  .top-bar-content {
    padding: 0.5rem 1rem;
  }

  .feedback-inline-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .feedback-modal-container {
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }

  .checkbox-group {
    grid-template-columns: 1fr;
  }

  .debug-panel {
    max-height: 400px;
  }
}

/* chat_ui: KaTeX display math scrolls instead of overflowing narrow screens */
.message .katex-display { overflow-x: auto; overflow-y: hidden; padding: 0.25rem 0; }

/* chat_ui: linked inline citations with a tooltip (document · page · site) */
.citation-link { color: var(--chat-accent); text-decoration: none; position: relative; }
.citation-link:hover, .citation-link:focus-visible { text-decoration: underline; }
.citation-link:hover::after, .citation-link:focus-visible::after {
  content: attr(data-tip);
  position: absolute; bottom: 140%; left: 50%; transform: translateX(-50%);
  width: max-content; max-width: 280px; white-space: normal;
  background: #222; color: #fff; padding: 0.35rem 0.55rem; border-radius: 6px;
  font-size: 0.75rem; line-height: 1.3; font-weight: 400; z-index: 20; pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* chat_ui: feedback stays changeable; the chosen thumb is highlighted, the other dimmed until hovered */
.feedback-inline-button.selected { color: var(--chat-accent); }
.feedback-inline-button.not-selected { opacity: 0.35; }
.feedback-inline-button.not-selected:hover, .feedback-inline-button.not-selected:focus-visible { opacity: 1; }

/* chat_ui: Turnstile renders nothing unless Cloudflare decides a human check is needed */
.turnstile-widget:empty { display: none; }
.turnstile-widget { margin: 0 0 0.5rem; }

/* chat_ui: starter prompts on the welcome screen (same look as follow-up chips) */
.starter-prompts { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; margin-top: 1.25rem; }
.starter-prompts .starter-prompt { max-width: 34rem; text-align: center; }

/* chat_ui: intake form additions (PERFORM's .user-info-form styles above are reused) */
.user-info-form .form-intro, .user-info-form .form-privacy { font-size: 0.85rem; color: #555; text-align: left; }
.user-info-form .form-privacy { margin: 0.5rem 0 0; }
.user-info-form .form-error { color: #b42318; font-size: 0.85rem; margin: 0.5rem 0 0; text-align: left; }
.form-done { font-size: 0.9rem; color: #555; margin-top: 0.5rem; }
