/* UpAssist: UpCloud brand overlay on Chainlit. Colours match brand/tokens.md. */

img[src*="logo_light"],
img[src*="logo_dark"],
img[src*="/logo"] {
  max-height: 1.75rem;
  width: auto;
}

/* Settings tabs: Chainlit stretches each tab to fill the row, which leaves a
   hole between the selected chip and the next label. Size the list to content. */
[role="tablist"] {
  width: max-content !important;
  max-width: 100%;
  display: inline-flex !important;
  gap: 0.25rem;
}

[role="tablist"] [role="tab"] {
  flex: 0 0 auto !important;
}

a {
  color: hsl(269 100% 50%);
}

/* Thread hover tooltips: wrap long titles, but keep short labels (Copy,
   Helpful) sized to their text. Do not set width — that pads short ones. */
[data-radix-popper-content-wrapper]:has(.px-3.py-1\.5) {
  max-width: min(22rem, calc(100vw - 1.5rem)) !important;
}

[data-side][data-state].px-3.py-1\.5 {
  width: fit-content;
  max-width: min(22rem, calc(100vw - 1.5rem));
  white-space: normal;
  overflow-wrap: break-word;
}

[data-side][data-state].px-3.py-1\.5 p {
  margin: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: break-word;
}

button.sa-msg-time {
  pointer-events: none;
  background: transparent !important;
  box-shadow: none !important;
  cursor: default;
  font-size: 0.75rem;
  font-weight: 400;
  color: hsl(269 8% 42%);
  padding-inline: 0.35rem;
}

/* Hide the whole tool row when "Show tool calls" is off. */
body[data-sa-tool-calls="0"] .sa-tool-step,
body[data-sa-tool-calls="0"] [data-step-type="tool"] {
  display: none !important;
}

/* Hide the response JSON, not the call args. First child of the accordion
   is the input; later siblings (except the action row) are the output. */
body[data-sa-tool-responses="0"] .sa-tool-output,
body[data-sa-tool-responses="0"] [data-step-type="tool"] .border-l-2.border-primary > :not(.-ml-1\.5) ~ :not(.-ml-1\.5) {
  display: none !important;
}

/* Copy / Feedback / timestamp sit in this row. Keep it visible. */
[data-step-type="assistant_message"] .-ml-1\.5.flex.items-center {
  display: flex !important;
}

.command-buttons-container {
  display: none !important;
}

#sa-summarise {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  margin-right: 0.1rem;
}

#sa-summarise:hover {
  background: hsl(var(--muted));
}

#sa-summarise:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Instant settings: hide Chainlit's confirm / cancel / reset bar. */
#confirm-sidebar,
#chat-settings-sidebar-content > .flex.gap-2.pt-4.border-t {
  display: none !important;
}
