/* =====================================================================
   agent_mark.css — the tile saying WHICH agent answered.

   Drawn by js/components/agent_mark.js in the rail's conversation list and
   the /chat sidebar, and by Jinja on /chats. Global (base_ds.html), like
   chat_row_menu.css, because all three surfaces draw it.

   TWO REGISTERS, and which one is the loud one is the whole design:

     .agent-mark--named    initials, agent accent  — a specific agent
     .agent-mark--default  neutral glyph           — no specific agent
     .agent-mark--gone     muted + dashed          — the agent was removed

   The DEFAULT register is the quiet one on purpose. It is the common case —
   most conversations run as the default agent — and a mark worn by most rows
   in the loudest style is a mark nobody reads within a day. The accent goes
   to the rarer, more specific claim.

   Colour is never the only signal: --named carries letters and --default
   carries a glyph, so the two stay apart in greyscale and for a reader who
   cannot separate the hues. --gone adds a dashed edge for the same reason.

   Tokens only. `--ds-kind-agent*` is the agent accent every other surface
   already uses (builder.css, components.css `.ds-kindtag[data-kind=agent]`)
   and it is theme-complete; the default register deliberately does NOT use
   `--ds-assistant`, close as the meaning is, because under the paper theme
   that family is in lockstep with `--ds-primary` — so a sky tile inside a
   `--ds-primary-light` active row would be sky on sky, and would read as an
   action rather than as an identity. A neutral tile for an identity we cannot
   colour is the same call rail.css's `.rail-logo-mono` already made.
   ===================================================================== */

.agent-mark {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    /* Not --ds-radius-btn (9px): that radius is the design system's shape
       for something you CLICK, and this tile is a statement. A tighter
       corner on a 20px square keeps it a mark rather than a small button. */
    border-radius: 5px;
    /* 9.5px in a 20px tile: two uppercase characters have to fit inside the
       glyph's own optical size, and the row's title carries the reading
       weight. Tabular figures so "Q3" sits on the same rhythm as "DH". */
    font-size: 9.5px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
    text-transform: uppercase;
    user-select: none;
}

.agent-mark-ico {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* A specific agent, named by its own initials. */
.agent-mark--named {
    background: var(--ds-kind-agent-soft);
    color: var(--ds-kind-agent);
}

/* No specific agent — the plain chat. Neutral, and the common case. */
.agent-mark--default {
    background: var(--ds-surface-sunken);
    color: var(--ds-text-secondary);
}

/* No agent to name — a conversation predating the column, or a Preview's
   scratch identity. An empty SLOT, not an absent one: the title flexes against
   this box, so dropping it would step that row's title left of every other and
   put a ragged edge down the list. It claims nothing, it only holds the place. */
.agent-mark--none {
    background: none;
    border: 0;
}

/* Removed, but still named: agents are soft-deleted, so the name survives and
   the conversation keeps saying who answered. Dashed rather than merely pale,
   so "gone" is a shape and not only a tint. */
.agent-mark--gone {
    background: transparent;
    color: var(--ds-text-muted);
    border: 1px dashed var(--ds-border);
}

/* ── In the conversation list ────────────────────────────────────────
   The rail list is a ~250px column, so the mark takes a fixed slot and the
   title flexes against it — the title truncates, the mark never does. */
html[data-ui-layout="rail"] .cloud-chat-list-link > .agent-mark {
    margin-right: 1px;
}

/* Collapsed sidebar (chat.js `applySidebarCollapse`) hides row text; the mark
   would be a second glyph competing with the row itself, so it goes too. */
.cloud-chat-sidebar.is-collapsed .agent-mark {
    display: none;
}

/* ── Origin pill — "you did not start this" ──────────────────────────
   A scheduled run and an agent-to-agent delegation both create a real
   conversation owned by the caller. Same slot and weight as the existing
   `.cloud-chat-surface-badge` ("Slack"), because it answers the same question
   about where a conversation came from. */
.chat-origin-badge {
    flex: 0 0 auto;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 1px 6px;
    border-radius: var(--ds-radius-pill);
    background: var(--ds-surface-sunken);
    color: var(--ds-text-muted);
    white-space: nowrap;
}
