/* Messages from other chats (frontend/chat/forwarded.js). Port of the Control UI 2026.11.6
   ui/src/pages/chat/components/chat-session-activity.css + chat-attribution.css; tokens mapped by meaning:
   --muted → --text-muted, --border → --border-color, --chat-participant-surface → a tint of --bg-tertiary
   (ClawChats has no per-participant palette). */

.fwd-attribution {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-width: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.fwd-attribution__icon,
.fwd-attribution__icon svg {
  width: 14px;
  height: 14px;
  flex: none;
}

/* Only the source title shortens; "N updates from" stays on one line. */
.fwd-attribution__label {
  flex: none;
  white-space: nowrap;
}

/* The source chat's name is the information here: link colour, as Control UI's a.markdown-session-link (--link). */
.fwd-attribution .activity-session-link { margin-left: 0; color: var(--link-color); }

/* The brief another chat started this one with: the source over the user's bubble. */
.message.user > .fwd-attribution {
  align-self: flex-end;
  margin-bottom: var(--space-1, 4px);
}

.fwd-activity {
  min-width: 0;
  width: 100%;
}

.fwd-activity__summary {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 2px 0;
  font-size: 13px;
  list-style: none;
  cursor: pointer;
}

.fwd-activity__summary::-webkit-details-marker { display: none; }

.fwd-activity__summary .fwd-attribution {
  flex-wrap: nowrap;
  font-size: inherit;
  overflow: hidden;
}

.fwd-activity__summary .fwd-source {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fwd-activity__chevron {
  display: inline-flex;
  flex: 0 0 14px;
  color: var(--text-muted);
}

.fwd-activity__chevron svg {
  width: 14px;
  height: 14px;
}

.fwd-activity[open] .fwd-activity__chevron { transform: rotate(90deg); }

.fwd-activity__summary:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
  border-radius: 4px;
}

.fwd-activity__body {
  margin: 8px 0 8px 10px;
  padding-inline-start: 12px;
  border-inline-start: 1px solid var(--border-color);
}

.fwd-message + .fwd-message { margin-top: 12px; }

/* Beats style.css `.message.assistant .message-content { background: transparent }` (0,3,0). */
.message.assistant.message--forwarded .fwd-message__bubble {
  padding: 8px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-tertiary) 55%, transparent);
  color: var(--text-primary);
}

.fwd-message__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 11px;
}

.fwd-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.fwd-copy-btn svg {
  width: 14px;
  height: 14px;
}

.fwd-copy-btn:hover,
.fwd-copy-btn:focus-visible {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.fwd-copy-btn.copied { color: var(--accent-text); }
