.thinking-card {
  width: min(100%, 420px);
  border: 1px solid var(--softBorder, var(--stroke, rgba(17, 24, 39, 0.14)));
  border-radius: 14px;
  background: var(--surface, var(--card-bg, #fff));
  color: var(--chatAssistantInk, var(--ink, #111));
  padding: 12px 14px;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.08);
}

html.dark-mode .thinking-card,
body.dark-mode .thinking-card {
  border-color: var(--softBorder, var(--stroke, #333));
  background: #000;
  color: var(--chatAssistantInk, var(--ink, #e0e0e0));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

.thinking-main {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.3;
}

.thinking-sub {
  margin-top: 7px;
  color: var(--muted, #6b7280);
  font-size: 0.78rem;
  line-height: 1.35;
}

html.dark-mode .thinking-sub,
body.dark-mode .thinking-sub {
  color: var(--muted, #bbb);
}

.thinking-orbit {
  position: relative;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(99, 102, 241, 0.32);
  border-color: color-mix(in srgb, var(--accent, #6366f1) 32%, transparent);
  animation: thinking-spin 1.25s linear infinite;
}

.thinking-orbit::before,
.thinking-orbit::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: var(--accent, #6366f1);
}

.thinking-orbit::before {
  width: 8px;
  height: 8px;
  top: -5px;
  left: 11px;
}

.thinking-orbit::after {
  width: 5px;
  height: 5px;
  right: 0;
  bottom: 3px;
  opacity: 0.75;
}

.thinking-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 11px;
}

.thinking-step {
  height: 4px;
  border-radius: 999px;
  background: var(--softBorder, rgba(17, 24, 39, 0.14));
  overflow: hidden;
}

.thinking-step::after {
  content: "";
  display: block;
  width: 45%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent, #6366f1);
  transform: translateX(-110%);
  animation: thinking-sweep 1.2s ease-in-out infinite;
}

.thinking-step:nth-child(2)::after { animation-delay: 0.16s; }
.thinking-step:nth-child(3)::after { animation-delay: 0.32s; }

.ai-thinking-inline {
  display: flex;
  justify-content: center;
  margin: 12px 0;
}

.ai-thinking-inline .thinking-card {
  box-shadow: none;
}

@keyframes thinking-spin {
  to { transform: rotate(360deg); }
}

@keyframes thinking-sweep {
  0% { transform: translateX(-110%); }
  55%, 100% { transform: translateX(230%); }
}

@media (prefers-reduced-motion: reduce) {
  .thinking-orbit,
  .thinking-step::after {
    animation: none;
  }
}
