/* Conversation thread: turns, bubbles, status lines, rich parts and action rows. */

.chat-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.thread-scroll {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 10px, #000 calc(100% - 28px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 10px, #000 calc(100% - 28px), transparent 100%);
}
.thread { flex: 1; width: 100%; padding: 4px 0 32px; }

.turn { padding: 0 var(--thread-gutter); }
.turn-inner { max-width: var(--thread-max); margin: 0 auto; }
@media (min-width: 768px) and (max-width: 1279px) { :root { --thread-max: 40rem; } }
@media (max-width: 767px) { :root { --thread-gutter: 16px; } }
.app[data-canvas="true"] .turn { padding: 0 20px; }

.turn-user .turn-inner { padding-top: 24px; display: flex; flex-direction: column; align-items: flex-end; }
.turn-assistant .turn-inner { padding-top: 16px; }
.thread > .turn:first-child .turn-inner,
.thread > :first-child > .turn:first-child .turn-inner { padding-top: 16px; }

/* user */
.user-row { display: flex; justify-content: flex-end; width: 100%; }
.user-bubble {
  position: relative;
  max-width: min(70%, 36rem);
  padding: 8px 16px;
  border-radius: 18px;
  background: var(--user-bubble);
  color: var(--user-bubble-text);
  font-size: 16px;
  line-height: 24px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.user-bubble[data-multiline="true"] { padding: 10px 16px; border-radius: 22px; }

.user-files { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-bottom: 8px; }

/* action rows */
.msg-actions {
  display: flex;
  align-items: center;
  gap: 0;
  min-height: 34px;
  margin-top: 4px;
  opacity: 0;
  transition: opacity 160ms ease;
}
.msg-actions .icon-btn { color: var(--icon-secondary); }
.msg-actions .icon-btn:hover { color: var(--icon-primary); }
.msg-actions .icon-btn.on { color: var(--icon-primary); background: transparent; }
.turn:hover .msg-actions,
.turn:focus-within .msg-actions,
.msg-actions[data-always="true"] { opacity: 1; }
.turn-assistant .msg-actions { margin-left: -8px; }
.user-actions { justify-content: flex-end; margin-right: -4px; }
@media (hover: none) { .msg-actions { opacity: 1; } }

/* status lines (thinking, searching, research) */

/* pending indicator */

@keyframes pending { 0%, 100% { transform: scale(0.72); opacity: 0.8; } 50% { transform: scale(1); opacity: 1; } }

/* image generation */

/* The blurred veil slides down to reveal the finished image from the top. Only transforms
   and opacity change per frame, so the effect stays on the compositor. */

@keyframes skel-slide { to { transform: translateX(100%); } }

/* canvas card */

/* errors */

/* sources button */

/* feedback + follow ups */

/* docked composer */
.composer-dock {
  position: relative;
  z-index: 10;
  flex: none;
  padding: 4px calc(var(--thread-gutter) + var(--scrollbar-gutter, 0px)) 0 var(--thread-gutter);
}
.dock-inner { position: relative; max-width: var(--thread-max); margin: 0 auto; }
.app[data-canvas="true"] .composer-dock { padding: 4px calc(16px + var(--scrollbar-gutter, 0px)) 0 16px; }

.scroll-down {
  position: absolute;
  left: 50%;
  top: -52px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--icon-primary);
  box-shadow: 0 4px 14px -4px rgba(0, 0, 0, 0.14), inset 0 0 0 1px var(--border-light);
  opacity: 0;
  transform: translate(-50%, 8px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 220ms var(--ease-out), background-color 120ms ease;
}
.scroll-down[data-show="true"] { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.scroll-down:hover { background: var(--bg-elevated-secondary); }

/* loading skeleton */
.thread-skel { max-width: var(--thread-max); margin: 0 auto; padding: 24px var(--thread-gutter); display: flex; flex-direction: column; gap: 28px; }
.skel-turn { display: flex; flex-direction: column; gap: 12px; }
.skel-turn.user { align-items: flex-end; }
.skel-bubble { height: 40px; border-radius: 18px; }
.skel-line { height: 14px; border-radius: 7px; }
.skel-block { height: 120px; border-radius: 16px; }

.not-found { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 48px 24px; text-align: center; }
.not-found h2 { font-size: 22px; font-weight: 600; }
.not-found .btn { margin-top: 8px; }
