/* #region zone:assistant.thinking-design — แถวคิดของ Luna: จุดเต้น ข้อความวาว เวลา ลูกศร และวงไฟปุ่มเปิดแชท */
/* Component tokens default to the host web's design-system tokens (Finance palette C, Account desk tokens). */
.luna-think {
  --luna-think-accent: var(--accent);
  --luna-think-ink: var(--text);
  --luna-think-muted: var(--muted);
  --luna-think-line: var(--line);
  align-self: flex-start;
  max-width: 100%;
  min-width: 0;
  color: var(--luna-think-muted);
  font-size: var(--t-label, 13px);
  line-height: 1.45;
  animation: luna-think-in 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}
.luna-think-head {
  display: inline-flex;
  align-items: center;
  gap: var(--u-space-2);
  max-width: 100%;
  min-height: 32px;
  margin: 0;
  padding: var(--u-space-1) var(--u-space-2);
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: default;
}
.luna-think.has-steps .luna-think-head {
  cursor: pointer;
}
.luna-think.has-steps .luna-think-head:hover {
  background: color-mix(in srgb, var(--luna-think-accent) 8%, transparent);
  color: var(--luna-think-ink);
}
.luna-think-head:disabled {
  opacity: 1;
}
.luna-think-head:focus-visible {
  outline: 2px solid var(--luna-think-accent);
  outline-offset: 2px;
}
/* One line that uses the whole panel width; … only when it really does not fit (full text in title).
   Extra line-height and block padding keep Thai marks above and below the line inside the
   background-clip box of the shimmer. */
.luna-think-text {
  flex: 0 1 auto;
  min-width: 0;
  padding: 2px 0;
  line-height: 1.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.luna-think.is-live .luna-think-text {
  color: transparent;
  background: linear-gradient(
      100deg,
      var(--luna-think-muted) 0 38%,
      var(--luna-think-ink) 50%,
      var(--luna-think-muted) 62% 100%
    )
    100% 0 / 260% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: luna-think-shine 1.8s linear infinite;
}
.luna-think.is-live .luna-think-text.is-swap {
  animation:
    luna-think-shine 1.8s linear infinite,
    luna-think-swap 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}
.luna-think-time {
  flex: 0 0 auto;
  color: var(--luna-think-muted);
  font-variant-numeric: tabular-nums;
}
.luna-think-chevron {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.luna-think:not(.has-steps) .luna-think-chevron {
  display: none;
}
.luna-think.is-open .luna-think-chevron {
  transform: rotate(90deg);
}

/* Three dots that orbit, merge in the middle and spring apart again: Luna's working mark. */
.luna-dots {
  position: relative;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
}
.luna-dots i {
  --turn: 0deg;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4.5px;
  height: 4.5px;
  margin: -2.25px 0 0 -2.25px;
  border-radius: 50%;
  background: var(--luna-think-accent);
  transform: rotate(var(--turn)) translateY(-4.5px);
}
.luna-dots i:nth-child(2) {
  --turn: 120deg;
  background: color-mix(in srgb, var(--luna-think-accent) 72%, var(--luna-think-ink));
}
.luna-dots i:nth-child(3) {
  --turn: 240deg;
  opacity: 0.7;
}
.luna-think.is-live .luna-dots i {
  animation: luna-dot-dance 1.6s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
.luna-think:not(.is-live) .luna-dots {
  display: none;
}

/* The steps Luna really ran, from the server, with a tick and the server time once each is done. */
.luna-think .luna-stages {
  display: grid;
  gap: 6px;
  margin: var(--u-space-1) 0 2px 7px;
  padding: 2px 0 2px 14px;
  border-left: 2px solid var(--luna-think-line);
  list-style: none;
  font-size: var(--t-caption, 12px);
}
.luna-think .luna-stages[hidden] {
  display: none;
}
.luna-think .luna-stage {
  display: flex;
  align-items: baseline;
  gap: var(--u-space-2);
  animation: luna-think-in 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}
.luna-think .luna-stage::before {
  content: '';
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1.5px solid var(--luna-think-muted);
  transform: translateY(-1px);
}
.luna-think .luna-stage.is-done::before {
  width: 9px;
  height: 5px;
  border-width: 0 0 2px 2px;
  border-color: var(--luna-think-accent);
  border-radius: 0;
  transform: translateY(-3px) rotate(-45deg);
}
.luna-think .luna-stage time {
  margin-left: auto;
  padding-left: var(--u-space-2);
  font-variant-numeric: tabular-nums;
}

@keyframes luna-dot-dance {
  0%,
  100% {
    transform: rotate(var(--turn)) translateY(-4.5px) scale(1);
  }
  30% {
    transform: rotate(calc(var(--turn) + 100deg)) translateY(-5.5px) scale(0.8);
  }
  55% {
    transform: rotate(calc(var(--turn) + 200deg)) translateY(-0.5px) scale(1.2);
  }
  78% {
    transform: rotate(calc(var(--turn) + 290deg)) translateY(-6px) scale(0.85);
  }
}
@keyframes luna-think-shine {
  to {
    background-position: -160% 0;
  }
}
@keyframes luna-think-swap {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
}
@keyframes luna-think-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

/* One clean brand ring around the launcher portrait; while Luna works it breathes a soft halo, so a
   minimised chat still says "busy". The host web sizes the launcher; this only paints the ring. */
.luna-launcher .luna-portrait {
  border: 0;
  background: color-mix(in srgb, var(--accent) 16%, var(--panel, #fff));
  box-shadow:
    0 0 0 2.5px var(--accent),
    0 6px 16px -6px rgb(0 0 0 / 0.35);
}
.luna-launcher.is-thinking .luna-portrait {
  animation: luna-launcher-glow 1.6s ease-in-out infinite;
}
@keyframes luna-launcher-glow {
  0%,
  100% {
    box-shadow:
      0 0 0 2.5px var(--accent),
      0 0 0 2.5px color-mix(in srgb, var(--accent) 40%, transparent),
      0 6px 16px -6px rgb(0 0 0 / 0.35);
  }
  50% {
    box-shadow:
      0 0 0 2.5px var(--accent),
      0 0 0 5.5px color-mix(in srgb, var(--accent) 0%, transparent),
      0 6px 16px -6px rgb(0 0 0 / 0.35);
  }
}

@media (pointer: coarse) {
  .luna-think-head {
    min-height: 44px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .luna-think,
  .luna-think .luna-stage {
    animation: none;
  }
  .luna-think.is-live .luna-dots i,
  .luna-think.is-live .luna-think-text,
  .luna-think.is-live .luna-think-text.is-swap {
    animation: none;
  }
  .luna-think.is-live .luna-think-text {
    color: var(--luna-think-muted);
    background: none;
  }
  .luna-think-chevron {
    transition: none;
  }
  .luna-launcher.is-thinking .luna-portrait {
    animation: none;
    box-shadow:
      0 0 0 2.5px var(--accent),
      0 0 0 5px color-mix(in srgb, var(--accent) 30%, transparent),
      0 6px 16px -6px rgb(0 0 0 / 0.35);
  }
}
/* #endregion */
