/* Galileo assistant: portrait, conversation surfaces and responsive layout. */
.ai-chat {
  --galileo-radius: 14px;
  --galileo-rule: #e5e9ef;
}
.ai-chat-fab, .is-starfield .ai-chat-fab {
  width: 56px;
  height: 56px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transition: opacity .2s ease, transform .18s ease;
}
.ai-chat-fab:hover, .ai-chat-fab.is-dragging { background: transparent; box-shadow: none; }
.galileo-avatar {
  display: block;
  position: relative;
  flex: none;
  width: 100%;
  height: 100%;
  border-radius: 0;
}
.galileo-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: contain;
}
.ai-chat-panel {
  border: 1px solid #dce2eb;
  border-radius: var(--galileo-radius);
  background: #fff;
  box-shadow: 0 16px 48px rgb(8 17 34 / 18%), 0 2px 8px rgb(8 17 34 / 5%);
}
.ai-chat-head { padding: 14px 12px 14px 16px; background: #fff; border-color: var(--galileo-rule); }
.ai-chat-title { gap: 10px; font-size: 17px; }
.ai-chat-title .galileo-avatar { width: 38px; height: 38px; }
.ai-chat-icon-button { border-radius: 8px; }
.ai-chat-context { padding: 8px 18px; border-color: var(--galileo-rule); }
.ai-chat-context-chip { font-weight: 400; }
.ai-chat-messages { padding: 18px 16px; gap: 16px; }
.ai-chat-bubble { max-width: 94%; padding: 12px 14px; border-radius: 12px; line-height: 1.75; }
.ai-chat-message.is-assistant .ai-chat-bubble {
  background: #f6f8fb;
  border: 1px solid #edf0f5;
  border-radius: 3px 12px 12px;
  color: var(--ink-soft);
}
.ai-chat-message.is-user .ai-chat-bubble {
  background: #edf3ff;
  border: 1px solid #e2ebfc;
  border-radius: 12px 3px 12px 12px;
}
.ai-chat-chips { gap: 7px; margin-top: 12px; }
.ai-chat-chips button { border-radius: 16px; padding: 6px 10px; background: #fff; }
.ai-chat-lens-form { padding-top: 13px; margin-top: 14px; border-top: 1px solid var(--galileo-rule); }
.ai-chat-lens-form input, .ai-chat-settings input { border-radius: 7px; }
.ai-chat-lens-form button, .ai-chat-save { border-radius: 7px; }
.ai-chat-composer { padding: 12px 16px; border-color: var(--galileo-rule); }
.ai-chat-composer textarea { min-width: 0; border-radius: 9px; background: #fff; font-size: 13px; }
.ai-chat-send { border-radius: 9px; }
.ai-chat-foot { background: #fff; border-top: 0; padding: 0 16px 12px; font-size: 10px; line-height: 1.6; }
/* Activity stays on the portrait, with no surrounding ring. */
.ai-chat:has(.ai-chat-send[aria-label="停止生成"]) .ai-chat-title .galileo-avatar {
  animation: galileo-thinking 1.6s ease-in-out infinite;
}
@keyframes galileo-thinking { 50% { opacity: .55; } }
@media (max-width: 760px) {
  .ai-chat-fab, .is-starfield .ai-chat-fab { width: 50px; height: 50px; }
  .ai-chat-panel, .dock-left .ai-chat-panel, .dock-top .ai-chat-panel {
    left: 12px; right: 12px; top: auto; bottom: 12px;
    width: auto; height: min(76dvh, 620px); max-height: calc(100dvh - 24px);
  }
  .ai-chat-head { padding: 12px; }
  .ai-chat-title { font-size: 16px; gap: 8px; }
  .ai-chat-title .galileo-avatar { width: 34px; height: 34px; }
  .ai-chat-messages { padding: 14px 12px; }
  .ai-chat-bubble { max-width: 100%; }
  .ai-chat-settings { flex-shrink: 0; max-height: calc(76dvh - 230px); overflow-y: auto; }
  .ai-chat-panel:has(.ai-chat-settings:not([hidden])) .ai-chat-messages { flex-basis: 0; min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .ai-chat .galileo-avatar { animation: none !important; }
}

.ai-chat-fab.is-dragging { transform: none; transition: none; }
