/* Chat flow: one 16px rhythm everywhere through the column gap. Input
   padding cap rides the skeleton. Under
   `[data-conversation-scroll]` the column host owns overflow and this view
   is ordinary flow (see ConversationRoot active-phase rules). */

.root {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}

.scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  /* Sides = composer clearance + 16px: on narrow viewports the transcript
     stays exactly 32px narrower than the input card (the shared width rule). */
  padding: 16px calc(var(--dsh-composer-side-clearance) + 16px);
}

:global([data-conversation-scroll]) .root {
  flex: 0 0 auto;
  min-height: auto;
  height: auto;
}

:global([data-conversation-scroll]) .scroll {
  overflow: visible;
  flex: 0 0 auto;
  min-height: auto;
}

/* Message column: shared chat width (ConversationRoot --dsh-chat-content-width),
   centered on the same axis as the input box (which caps at chat + 16px); the
   scroller itself stays full-bleed. */
.column {
  max-width: var(--dsh-chat-content-width);
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Settled-flow identity boundary. It is neutral today and becomes the natural
   measurement/mount unit for a virtualizer without changing the column gap. */
.flowItem {
  min-width: 0;
}

/* A keyed renderer may intentionally decline its row after dispatch (the
   completed-turn tail does this when it owns neither actions nor extensions).
   An empty flex item must not consume the column gap. */
.flowItem:empty {
  display: none;
}

.callRow {
  border-radius: 6px;
}

/* Selection still sets data-selected for details linkage; no outline —
   tool rows match Think chrome (no selected ring). */

/* Turn activity keeps the former loader's one-line footprint. A pale
   brand-blue band sweeps from left to right; reduced-motion keeps it static. */
.turnStatus {
  align-self: flex-start;
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 26px;
  font: var(--dsw-font-s-strong-14);
  white-space: nowrap;
  background: linear-gradient(
    90deg,
    var(--dsw-static-deepseek-500) 0%,
    var(--dsw-static-deepseek-500) 40%,
    var(--dsw-static-deepseek-200) 50%,
    var(--dsw-static-deepseek-500) 60%,
    var(--dsw-static-deepseek-500) 100%
  );
  background-position: 100% 0;
  background-size: 250% 100%;
  background-clip: text;
  color: transparent;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: dsh-turn-status-shimmer 1.8s linear infinite;
}

.turnStatusClock {
  margin-left: 8px;
  font: var(--dsw-font-xs-13);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  color: var(--dsw-alias-label-caption);
  -webkit-text-fill-color: var(--dsw-alias-label-caption);
}

@keyframes dsh-turn-status-shimmer {
  to {
    background-position: 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .turnStatus {
    background-position: 0 0;
    background-size: 100% 100%;
    animation: none;
  }
}

.hint {
  color: var(--dsw-alias-label-tertiary);
  font-size: 12px;
  line-height: 18px;
}

.openError {
  color: var(--dsw-alias-state-error-primary);
  font-size: 12px;
  line-height: 18px;
}

.older {
  display: flex;
  justify-content: center;
}

.older button {
  border: none;
  border-radius: 14px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--dsw-alias-label-secondary);
  background: var(--dsw-alias-interactive-bg-hover-solid);
  cursor: pointer;
}

.older button:disabled {
  cursor: default;
  opacity: 0.6;
}

/* Back-to-bottom: zero-height sticky slot so the control does not extend
   scrollHeight; the button translates up into the viewport. Under the
   conversation host, clearance sits above the sticky composer stack. */
.toBottomSlot {
  position: sticky;
  bottom: 16px;
  /* Above the sticky composer (z-index 7) so the control stays clickable and
     visible over the input card. */
  z-index: 8;
  height: 0;
  display: flex;
  justify-content: flex-end;
  padding-right: max(0px, calc((100% - var(--dsh-chat-content-width)) / 2));
  pointer-events: none;
}

:global([data-conversation-scroll]) .toBottomSlot {
  /* Clears the sticky composer stack (docks + input card + stats): the live
     height rides --dsh-composer-height (ConversationRoot's seat observer) so
     the control follows a growing textarea; the fallback covers the first
     paint before the observer fires. */
  bottom: calc(var(--dsh-composer-height, 152px) + 16px);
}

.toBottom {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-top: -34px;
  padding: 0;
  border: 1px solid var(--dsw-alias-border-l2);
  border-radius: 100px;
  color: var(--dsw-alias-label-primary);
  background: var(--dsw-alias-button-floating-fill);
  box-shadow: var(--dsw-shadow-lv2);
  cursor: pointer;
  pointer-events: auto;
}

.toBottom:hover {
  background: var(--dsw-alias-button-floating-hover);
}
