Skip to content

#1 PDF Application on GitHub that lets you edit PDFs on any device anywhere

12.0 KB
Raw Blame
/* The conversation between the dock's header and its composer. It is what
   gives way as the dock collapses, so it clips instead of pushing the composer. */
.chat-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

[data-mantine-color-scheme="dark"] .chat-quick-action {
  background: transparent;
}

[data-mantine-color-scheme="dark"] .chat-quick-action:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--c-border-subtle);
}

.chat-panel-messages {
  flex: 1;
  min-height: 0;
  /* Establish a size container so the message list's bottom padding can be
     expressed relative to the scroll viewport height (cqh) below. */
  container-type: size;
}

/* Extra room beneath the last message so that, scrolled to the bottom, the most
   recent turn rests near the vertical centre of the conversation rather than
   jammed against the composer. cqh is a fraction of the scroll viewport height. */
.chat-panel-messages__content {
  padding-bottom: 15cqh;
}

/* Quick action cards above the input. */
.chat-panel__quick-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem 0 0.25rem;
  /* When the panel is short, this block shrinks and
     scrolls internally instead of pushing the composer off-screen — the input
     must always stay pinned and visible at the bottom. */
  flex-shrink: 1;
  min-height: 0;
  overflow-y: auto;
}

.chat-panel__quick-actions-label {
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 0.25rem;
  margin-bottom: 0.1rem;
}

.chat-quick-action {
  display: block;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--c-border-subtle);
  border-radius: 0.65rem;
  background: var(--mantine-color-body);
  transition:
    background 120ms ease-out,
    border-color 120ms ease-out;
}

.chat-quick-action:hover {
  background: var(--mantine-color-default-hover);
  border-color: var(--mantine-color-default-border);
}

.chat-quick-action__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: var(--mantine-color-blue-light);
  color: var(--c-accent-text);
  flex-shrink: 0;
}

/* Let the label fill the row and align left so the badge sits flush left and
   the chevron (rightSection) is pushed to the far right. */
.chat-quick-action .mantine-Button-label {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.chat-panel-input {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-shrink: 0;
  padding: 0.25rem 0.25rem 0.25rem 0.75rem;
  border: 1px solid var(--c-border-subtle);
  border-radius: 0.875rem;
  background: var(--c-input-bg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition:
    border-color 160ms ease-out,
    box-shadow 160ms ease-out;
}

.chat-panel-input:focus-within {
  border-color: var(--c-border);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

/* The wrapper owns the chrome, so the Mantine field's own is cleared. */
.chat-panel-input__field,
.chat-panel-input__field:focus,
.chat-panel-input__field:focus-visible {
  font-size: 0.95rem;
  /* One line plus padding matches the 30px send button. Mantine's input
     min-height is taller, which left the text sitting high in the row. */
  line-height: 1.375rem;
  min-height: 0 !important;
  padding: 0.25rem 0.125rem !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

.chat-panel-input__textarea {
  flex: 1;
  min-width: 0;
}

.chat-panel-input .mantine-ActionIcon-root {
  flex-shrink: 0;
  align-self: flex-end;
  /* Concentric with the composer's corner: its 0.875rem radius less the 0.25rem inset. */
  --ai-radius: 0.625rem;
}

/* AI disclaimer. Two presentations share one base:
   - --banner: a soft grey card below the header on the welcome screen.
   - --inline: a compact line pinned above the composer once a chat is underway. */
.chat-panel-disclaimer {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
  color: var(--c-text-subtle);
}

.chat-panel-disclaimer__icon {
  flex-shrink: 0;
  opacity: 0.8;
}

/* Welcome-screen banner: a little grey box just under the header. */
.chat-panel-disclaimer--banner {
  margin: 0.25rem 0 0;
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--c-border-subtle);
  border-radius: 0.65rem;
  background: var(--mantine-color-gray-light);
  font-size: 0.78rem;
  line-height: 1.4;
}

/* Compact line above the composer once the conversation has started. */
.chat-panel-disclaimer--inline {
  /* Inset to line up with the composer's text below. */
  padding: 0.25rem 0.9375rem 0;
  font-size: 0.7rem;
  line-height: 1.3;
  text-wrap: pretty;
}

/* Message layout */
.chat-message {
  display: flex;
}

.chat-message-user {
  justify-content: flex-end;
  margin: 0.2rem 0;
}

.chat-message-user__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  max-width: 85%;
}

.chat-message-assistant {
  justify-content: flex-start;
}

/* Hover action row — copy, like, timestamp */
.chat-message-actions {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin-top: 0.3rem;
  opacity: 0;
  transition: opacity 120ms ease-out;
  pointer-events: none;
}

.chat-message:hover .chat-message-actions,
.chat-message-actions:focus-within {
  opacity: 1;
  pointer-events: auto;
}

.chat-message-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: none;
  border-radius: 0.375rem;
  background: transparent;
  color: var(--c-text-subtle);
  cursor: pointer;
  transition:
    background 100ms ease-out,
    color 100ms ease-out;
}

.chat-message-action-btn:hover {
  background: var(--mantine-color-default-hover);
  color: var(--mantine-color-text);
}

.chat-message-action-btn--active {
  color: var(--c-accent-text);
}

.chat-message-timestamp {
  font-size: 0.7rem;
  color: var(--c-text-subtle);
  padding: 0 0.25rem;
  white-space: nowrap;
}

/* Bubble styling — user only */

.chat-bubble {
  width: fit-content;
  max-width: 100%;
}

.chat-bubble-user {
  background: var(--c-btn-solid) !important;
  color: var(--c-btn-inverse) !important;
}

.chat-bubble-user * {
  color: var(--c-btn-inverse) !important;
}

/* Assistant messages: no bubble, free-flowing with side padding */
.chat-bubble-assistant {
  width: 100%;
  padding: 0 0.5rem;
  font-size: var(--mantine-font-size-sm);
}

.chat-bubble-assistant p {
  margin: 0 0 0.5em;
}

.chat-bubble-assistant p:last-child {
  margin-bottom: 0;
}

/* ─── Live progress indicator ──────────────────────────────────────────── */

/*
 * Shown while the AI works — one step at a time, no growing list. Our animated
 * logo sits on the left, the current step's label shimmers in the middle, and
 * the phase-specific icon (what it's doing right now) sits on the right.
 */
.chat-progress-live {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.2rem 0.5rem 0.35rem;
}

.chat-progress-live__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--c-brand-mark);
}

/* Shimmer: a soft highlight sweeps left-to-right across the muted label. */
.chat-progress-live__label {
  flex: 1;
  min-width: 0;
  font-size: 0.875rem;
  line-height: 1.35;
  background: linear-gradient(
    90deg,
    var(--c-text-subtle) 0%,
    var(--c-text-subtle) 40%,
    var(--mantine-color-text) 50%,
    var(--c-text-subtle) 60%,
    var(--c-text-subtle) 100%
  );
  background-size: 200% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: chat-shimmer 1.8s linear infinite;
}

.chat-progress-live__phase-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  overflow: hidden;
  color: var(--c-text-subtle);
  animation: chat-phase-pulse 1.6s ease-in-out infinite;
}

@keyframes chat-shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

@keyframes chat-phase-pulse {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/*
 * Wrapper that scales a registry tool icon (typically 1.5rem/24px)
 * down to fit the compact icon slots used by the live indicator and the
 * completed tool list. Transform does not affect layout, so the parent's
 * overflow:hidden clips the un-scaled footprint cleanly.
 */
.chat-step-icon-scaled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.75);
  transform-origin: center;
  flex-shrink: 0;
}

/* ─── Completed tool breakdown ─────────────────────────────────────────── */

/*
 * Shown above each completed assistant turn. The toggle displays a small
 * "Ran for X seconds" label; expanding reveals a numbered list of just the
 * tools that ran. Turns with no tools show the duration as a plain label.
 */

.chat-completed-log {
  margin-bottom: 0.55rem;
}

.chat-completed-log__toggle {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.25rem 0.1rem 0.1rem;
  border-radius: 0.35rem;
  color: var(--c-text-subtle);
  transition: background 120ms ease-out;
}

.chat-completed-log__toggle:hover {
  background: var(--mantine-color-default-hover);
}

.chat-completed-log__static {
  display: inline-block;
  padding: 0.1rem;
}

/* Numbered list of the tools that ran — icon + name, no connector lines. */
.chat-completed-log__tools {
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.chat-completed-log__tool {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0.25rem;
  font-size: 0.8rem;
  color: var(--mantine-color-text);
}

.chat-completed-log__tool-num {
  flex-shrink: 0;
  min-width: 1.1rem;
  text-align: right;
  font-size: 0.75rem;
  color: var(--c-text-subtle);
  font-variant-numeric: tabular-nums;
}

.chat-completed-log__tool-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  overflow: hidden;
  color: var(--c-text-subtle);
}

.chat-completed-log__tool-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Legacy thinking indicator (kept in case any other code references it). */
.chat-thinking {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.125rem 0.5rem;
  color: var(--c-accent-text);
}

@media (prefers-reduced-motion: reduce) {
  .chat-progress-live__label {
    animation: none;
    background: none;
    -webkit-text-fill-color: var(--c-text-subtle);
    color: var(--c-text-subtle);
  }
  .chat-progress-live__phase-icon {
    animation: none;
    opacity: 0.85;
  }
}

/* ─── Stirling logo thinking animation ─────────────────────────────────── */

.stirling-thinking__path-right {
  animation: stirling-orbit-right 2s ease-in-out infinite;
}

.stirling-thinking__path-left {
  animation: stirling-orbit-left 2s ease-in-out infinite;
}

@keyframes stirling-orbit-right {
  0%,
  100% {
    transform: translate(0, 0);
    opacity: 0.5;
  }
  25% {
    transform: translate(-1px, -5px);
    opacity: 0.45;
  }
  50% {
    transform: translate(-6px, 0);
    opacity: 0.9;
  }
  75% {
    transform: translate(-1px, 5px);
    opacity: 0.55;
  }
}

@keyframes stirling-orbit-left {
  0%,
  100% {
    transform: translate(0, 0);
    opacity: 1;
  }
  25% {
    transform: translate(1px, 5px);
    opacity: 0.85;
  }
  50% {
    transform: translate(6px, 0);
    opacity: 0.5;
  }
  75% {
    transform: translate(1px, -5px);
    opacity: 0.85;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stirling-thinking__path-right {
    animation: none;
    opacity: 0.5;
  }
  .stirling-thinking__path-left {
    animation: none;
    opacity: 1;
  }
}