/* Phase 5 AI-interaction polish.
   Keeps the existing layout, but makes the answer controls and reveal cadence
   feel closer to a compact AI response surface. */

.assistant-feedback {
  margin-block-start: 16px;
  padding-block-start: 14px;
}

.assistant-feedback-question {
  font-size: .8rem;
  font-weight: 500;
  color: var(--assistant-muted);
}

.assistant-feedback-actions {
  margin-block-start: 6px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.assistant-feedback-button {
  position: relative;
  inline-size: 36px;
  block-size: 36px;
  min-inline-size: 36px;
  min-block-size: 36px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  color: var(--assistant-muted);
  background: transparent;
  box-shadow: none;
}

.assistant-feedback-button > span {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.assistant-feedback-button img {
  inline-size: 19px;
  block-size: 19px;
  opacity: .68;
}

.assistant-feedback-button:hover,
.assistant-feedback-button:focus-visible {
  color: var(--assistant-text);
  border: 0;
  background: color-mix(in srgb, var(--assistant-surface) 74%, transparent);
  transform: none;
}

.assistant-feedback-button[aria-pressed="true"] {
  color: var(--assistant-accent);
  border: 0;
  background: var(--assistant-accent-soft);
}

.assistant-feedback-button:hover img,
.assistant-feedback-button:focus-visible img,
.assistant-feedback-button[aria-pressed="true"] img {
  opacity: 1;
}

.assistant-feedback-status {
  min-block-size: 1.25em;
  margin-block-start: 4px !important;
  font-size: .68rem;
}

/* Give each card enough time to settle while the next one begins entering. */
.assistant-result.is-waiting {
  transform: translateY(20px) scale(.99);
}

.assistant-result.is-visible {
  transition:
    opacity .7s cubic-bezier(.22, 1, .36, 1),
    transform .7s cubic-bezier(.22, 1, .36, 1);
}

/* Make the thinking line read as an intentional AI state. */
[data-assistant][data-state="pending"] .assistant-status-row {
  min-block-size: 38px;
}

[data-assistant][data-state="pending"] .assistant-status-spark {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--assistant-accent-soft) 55%, transparent);
}

/* Start the shared phase slightly in-progress so the first painted frame is
   already visibly animated. This avoids a compositor-dependent 0deg startup
   frame while preserving one inherited phase for the composer edge + halo. */
[data-assistant][data-phase-motion="true"][data-state="pending"] .assistant-composer,
[data-assistant][data-phase-motion="true"][data-state="revealing"] .assistant-composer {
  animation-delay: -120ms;
}

@media (max-width: 760px) {
  .assistant-feedback-actions {
    overflow: visible;
    padding-block-end: 0;
  }

  .assistant-feedback-button {
    flex: 0 0 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .assistant-result.is-visible {
    transition: none !important;
  }
}
