/* #region zone:desk.style.chat-activity — แผงขั้นตอนที่ AI ทำ (หัวพับได้ แถวต่อขั้น ท้ายแผงสด) */
/* Flag desk_chat_activity. Tokens only (desk-tokens.css), light and dark follow the theme. Every box wraps
   and shrinks (min-width: 0), controls keep >= var(--sp-2) apart, nothing depends on a breakpoint. */
.chat-think.has-activity {
  max-width: 100%;
  width: 100%;
}
.chat-think.has-activity > :not(.chat-act) {
  display: none;
}
.chat-act {
  min-width: 0;
  color: var(--muted);
  font-size: var(--u-text-sm);
}
.chat-act[hidden] {
  display: none;
}
.chat-act-head {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  max-width: 100%;
  min-height: 32px;
  padding: var(--sp-1) var(--sp-2);
  border: 0;
  border-radius: var(--r-control);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.chat-act-head:hover {
  background: var(--hover);
  color: var(--text);
}
.chat-act-title {
  min-width: 0;
  overflow-wrap: anywhere;
}
.chat-act-chev {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: -3px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
[aria-expanded='true'] > .chat-act-chev {
  margin-top: 3px;
  transform: rotate(225deg);
}
.chat-act-list {
  list-style: none;
  margin: var(--sp-1) 0 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-inner);
  background: var(--panel);
  overflow: hidden;
}
.chat-act-list[hidden] {
  display: none;
}
.chat-act-row + .chat-act-row {
  border-top: 1px solid var(--line);
}
.chat-act-rowhead {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  width: 100%;
  min-height: 36px;
  padding: var(--sp-2) var(--sp-3);
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}
.chat-act-rowhead:disabled {
  opacity: 1;
  cursor: default;
}
.chat-act-row.has-detail > .chat-act-rowhead {
  cursor: pointer;
}
.chat-act-row.has-detail > .chat-act-rowhead:hover {
  background: var(--hover);
}
.chat-act-label {
  flex: 0 0 auto;
  color: var(--muted);
}
.chat-act-target {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-act-failed {
  flex: 0 0 auto;
  color: var(--down-text);
  font-weight: 600;
}
.chat-act-row.is-running .chat-act-label::after {
  content: '…';
}
.chat-act-rowhead .chat-act-chev {
  align-self: center;
}
.chat-act-rowhead:disabled .chat-act-chev {
  visibility: hidden;
}
.chat-act-detail {
  padding: 0 var(--sp-3) var(--sp-3);
  overflow-wrap: anywhere;
}
.chat-act-detail[hidden] {
  display: none;
}
.chat-act-line {
  margin: 0 0 var(--sp-1);
  color: var(--text);
}
.chat-act-line-label {
  margin: var(--sp-2) 0 var(--sp-1);
  color: var(--muted);
  font-size: var(--u-text-xs);
}
.chat-act-line .chat-act-line-label {
  margin: 0 var(--sp-2) 0 0;
}
.chat-act-sources {
  list-style: none;
  margin: 0;
  padding: 0;
}
.chat-act-source {
  margin-bottom: var(--sp-2);
}
.chat-act-link {
  color: var(--accent-text);
  text-decoration: underline;
  overflow-wrap: anywhere;
}
.chat-act-source-title {
  display: block;
  color: var(--muted);
  font-size: var(--u-text-xs);
  overflow-wrap: anywhere;
}
.chat-act-foot {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-2) 0;
  color: var(--muted);
}
.chat-act-foot[hidden] {
  display: none;
}
.chat-act-foot-phrase {
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr);
  flex: 0 1 auto;
  min-width: 0;
}
.chat-act-foot-phrase > span {
  grid-area: 1 / 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: 1.6; /* Thai marks stay inside the clipped box */
}
.chat-act-foot-phrase > .out {
  animation: chatActRiseOut 0.4s ease both;
}
.chat-act-foot-secs {
  flex: 0 0 auto;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.chat-act-shimmer {
  background: linear-gradient(
    100deg,
    var(--muted) 0%,
    var(--muted) 38%,
    var(--text) 50%,
    var(--muted) 62%,
    var(--muted) 100%
  );
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: chatActSweep 3.2s linear infinite;
}
.chat-act-foot-phrase > .in.chat-act-shimmer {
  animation:
    chatActRiseIn 0.6s ease both,
    chatActSweep 3.2s linear infinite;
}
@keyframes chatActSweep {
  from {
    background-position: 125% 0;
  }
  to {
    background-position: -125% 0;
  }
}
@keyframes chatActRiseIn {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes chatActRiseOut {
  to {
    opacity: 0;
    transform: translateY(-7px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .chat-act-foot-phrase > .in,
  .chat-act-foot-phrase > .in.chat-act-shimmer {
    animation: none;
  }
  .chat-act-foot-phrase > .out {
    display: none;
  }
  .chat-act-shimmer {
    background: none;
    color: var(--text);
  }
  .chat-act-chev {
    transition: none;
  }
}
/* #endregion */
