[data-thinking-assistant-trigger] {
  display: none !important;
}

.aos-thinking-floating-trigger {
  position: fixed !important;
  right: max(26px, calc(env(safe-area-inset-right) + 18px)) !important;
  bottom: max(26px, calc(env(safe-area-inset-bottom) + 18px)) !important;
  left: auto !important;
  top: auto !important;
  z-index: 950 !important;
  display: grid !important;
  place-items: center !important;
  width: 56px !important;
  height: 56px !important;
  min-width: 56px !important;
  min-height: 56px !important;
  padding: 0 !important;
  border: 1px solid rgba(115, 92, 255, .34) !important;
  border-radius: 19px !important;
  color: inherit;
  background: rgba(255, 255, 255, .96) !important;
  box-shadow: 0 18px 42px rgba(46, 35, 112, .24) !important;
  backdrop-filter: blur(18px);
  transition: transform .18s ease, box-shadow .18s ease;
}

.aos-thinking-floating-trigger .aos-thinking-orb {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  font-size: 20px;
}

.aos-thinking-floating-trigger:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 22px 52px rgba(46, 35, 112, .3) !important;
}

.aos-thinking-floating-trigger:active {
  transform: translateY(-1px) scale(.98);
}

body.aos-thinking-open .aos-thinking-floating-trigger {
  pointer-events: none;
  opacity: 0;
}

@supports selector(body:has(*)) {
  body:has([data-attention-handoff]) .aos-thinking-floating-trigger {
    bottom: max(210px, calc(env(safe-area-inset-bottom) + 190px)) !important;
  }
}

.aos-thinking-main {
  display: flex !important;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  gap: 12px !important;
  overflow: hidden !important;
}

.aos-thinking-context {
  flex: 0 0 auto;
  max-height: 245px;
  overflow-y: auto;
}

.aos-thinking-chat-shell {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 300px;
  overflow: hidden;
  border: 1px solid rgba(115, 92, 255, .16);
  border-radius: 18px;
  background: linear-gradient(180deg, #f8f7fc 0%, #fff 100%);
  box-shadow: 0 18px 42px rgba(31, 25, 68, .07);
}

.aos-thinking-conversation {
  display: flex !important;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 11px;
  min-height: 190px;
  max-height: none !important;
  overflow-y: auto;
  padding: 16px;
  scroll-behavior: smooth;
}

.aos-thinking-empty {
  display: grid;
  place-content: center;
  min-height: 100%;
  padding: 24px;
  color: var(--aos-muted, #747684);
  text-align: center;
}

.aos-thinking-empty strong,
.aos-thinking-empty span {
  display: block;
}

.aos-thinking-empty strong {
  color: var(--aos-ink, #12131b);
  font-size: 14px;
  font-weight: 850;
}

.aos-thinking-empty span {
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.45;
}

.aos-thinking-message {
  display: grid;
  gap: 5px;
  width: fit-content;
  max-width: 84%;
  padding: 11px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.55;
  white-space: normal;
  overflow-wrap: anywhere;
}

.aos-thinking-message small {
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.aos-thinking-message-body {
  min-width: 0;
  white-space: normal;
}

.aos-thinking-message.user .aos-thinking-message-body {
  white-space: pre-wrap;
}

.aos-thinking-message-body p,
.aos-thinking-message-body h3,
.aos-thinking-message-body h4,
.aos-thinking-message-body ul,
.aos-thinking-message-body ol {
  margin: 0;
}

.aos-thinking-message-body p + p,
.aos-thinking-message-body p + ul,
.aos-thinking-message-body p + ol,
.aos-thinking-message-body ul + p,
.aos-thinking-message-body ol + p,
.aos-thinking-message-body h3 + p,
.aos-thinking-message-body h4 + p {
  margin-top: 8px;
}

.aos-thinking-message-body h3,
.aos-thinking-message-body h4 {
  color: var(--aos-ink, #12131b);
  font-size: 13px;
  line-height: 1.35;
}

.aos-thinking-message-body ul,
.aos-thinking-message-body ol {
  padding-left: 20px;
}

.aos-thinking-message-body li + li {
  margin-top: 4px;
}

.aos-thinking-message-body code {
  padding: 1px 5px;
  border-radius: 6px;
  background: #f0eef8;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .92em;
}

.aos-thinking-message.user {
  align-self: flex-end;
  color: #fff;
  background: linear-gradient(135deg, #735cff, #5b43ed);
  box-shadow: 0 12px 28px rgba(91, 67, 237, .2);
  border-bottom-right-radius: 5px;
}

.aos-thinking-message.user small {
  color: rgba(255, 255, 255, .72);
}

.aos-thinking-message.assistant {
  align-self: flex-start;
  color: var(--aos-text, #1a1b24);
  background: #fff;
  border: 1px solid var(--aos-line, #e4e4ec);
  box-shadow: 0 12px 28px rgba(25, 22, 43, .06);
  border-bottom-left-radius: 5px;
}

.aos-thinking-message.assistant small {
  color: var(--aos-accent, #735cff);
}

.aos-thinking-message.assistant.latest {
  border-color: rgba(115, 92, 255, .3);
  box-shadow: 0 16px 38px rgba(91, 67, 237, .12);
  animation: aos-thinking-response-ready .35s ease both;
}

.aos-thinking-message.pending {
  color: var(--aos-muted, #747684);
  border-style: dashed;
  background: linear-gradient(90deg, #fff, #f1efff, #fff);
  background-size: 220% 100%;
  animation: aos-thinking-pending 1.35s linear infinite;
}

.aos-thinking-form.aos-thinking-chat-composer {
  display: grid !important;
  flex: 0 0 auto;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px !important;
  align-items: end;
  padding: 12px !important;
  border: 0 !important;
  border-top: 1px solid var(--aos-line, #e4e4ec) !important;
  border-radius: 0 !important;
  background: rgba(255, 255, 255, .96) !important;
  box-shadow: none !important;
}

.aos-thinking-chat-label,
.aos-thinking-form.aos-thinking-chat-composer .aos-thinking-status,
.aos-thinking-form.aos-thinking-chat-composer footer > span {
  display: none !important;
}

.aos-thinking-form.aos-thinking-chat-composer textarea {
  grid-column: 1;
  width: 100%;
  min-height: 52px !important;
  max-height: 120px;
  resize: none !important;
  padding: 14px 15px !important;
  border-radius: 15px !important;
  font-size: 13px;
}

.aos-thinking-form.aos-thinking-chat-composer footer {
  display: contents !important;
}

.aos-thinking-form.aos-thinking-chat-composer button[type="submit"] {
  grid-column: 2;
  min-width: 86px;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 15px;
}

.aos-thinking-form[data-thinking-busy="1"] textarea,
.aos-thinking-form[data-thinking-busy="1"] button {
  opacity: .65;
}

.aos-thinking-form[data-thinking-busy="1"] button {
  pointer-events: none;
}

@keyframes aos-thinking-response-ready {
  from { opacity: .45; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes aos-thinking-pending {
  from { background-position: 100% 0; }
  to { background-position: -120% 0; }
}

@media (max-width: 820px) {
  .aos-thinking-floating-trigger {
    right: max(16px, calc(env(safe-area-inset-right) + 10px)) !important;
    bottom: calc(86px + env(safe-area-inset-bottom)) !important;
    width: 52px !important;
    height: 52px !important;
    min-width: 52px !important;
    min-height: 52px !important;
    border-radius: 17px !important;
  }

  .aos-thinking-floating-trigger .aos-thinking-orb {
    width: 37px;
    height: 37px;
    border-radius: 12px;
  }

  .aos-thinking-main {
    padding: 12px !important;
  }

  .aos-thinking-context {
    max-height: 205px;
  }

  .aos-thinking-chat-shell {
    min-height: 360px;
  }

  .aos-thinking-conversation {
    padding: 13px;
  }

  .aos-thinking-message {
    max-width: 90%;
    font-size: 12.5px;
  }

  .aos-thinking-form.aos-thinking-chat-composer {
    grid-template-columns: minmax(0, 1fr) 52px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom)) !important;
  }

  .aos-thinking-form.aos-thinking-chat-composer button[type="submit"] {
    min-width: 52px;
    width: 52px;
    padding: 0;
    font-size: 0;
  }

  .aos-thinking-form.aos-thinking-chat-composer button[type="submit"] i {
    font-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .aos-thinking-floating-trigger,
  .aos-thinking-message.assistant.latest,
  .aos-thinking-message.pending {
    animation: none;
    transition: none;
  }
}