/* ============================================================
   CHAT-TO-CHAT MESSAGES (batch 4 §5)
   A message another of the user's chats sent with the chats tool carries a small
   "From: <chat title>" line above its bubble; it links to that chat (a span once the
   chat is gone). The UI overhaul (batch 4 §9 phase 2, brief §6.5) draws it as a quiet line with a reply arrow, the
   link in the accent text (its words are one text node, so the whole line takes the link colour). Tokens only
   (tokens.css + the profile theme).
   ============================================================ */
.message:has(.user-label) > .relay-from {
    justify-self: end;
    display: block;
    max-width: min(80%, 28rem);
    margin: calc(-1 * var(--space-1)) 0 6px;
    padding: 2px 4px;
    border-radius: var(--radius-xs);
    color: var(--c-on-3);
    font: var(--t-body-s);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* the reply arrow sits inline before the words, so a long title still ends in an ellipsis (a flex line would
   clip it mid-word: its text becomes an anonymous item that text-overflow does not reach) */
.message:has(.user-label) > .relay-from::before {
    content: '';
    display: inline-block;
    width: 15px;
    height: 15px;
    margin-right: 6px;
    vertical-align: -3px;
    background: var(--c-on-3);
    -webkit-mask: var(--icon-reply) center / contain no-repeat;
    mask: var(--icon-reply) center / contain no-repeat;
}
.message:has(.user-label) > a.relay-from { color: var(--c-accent-text); font-weight: 500; transition: background-color var(--dur-1) var(--ease-standard); }
.message:has(.user-label) > a.relay-from:hover { background: var(--c-hover); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 768px) {
    .message:has(.user-label) > .relay-from { max-width: 88%; }
}
@media (forced-colors: active) {
    .message:has(.user-label) > .relay-from::before { forced-color-adjust: none; background: CanvasText; }
}
