/* ════════════════════════════════════════════════════════════════════════
   Active-target scope pills — controls/chat-widget/modules/active-target.js
   ════════════════════════════════════════════════════════════════════════
   Moved out of css/apps/chat-features.css (which only the Chat app loads) when
   the shell assistant's orb gained its Space pill (owner, 2026-10-16). The shell
   page links this sheet (index.html), so every host of the pill reads it: Chat's
   project pills, and the orb's one Space pill with its chevron and its "Choose a
   Space" resting state. */

/* ── Active-target scope pills (auth-capability arc C2 Lane D; set-valued
   since the TS slice — one pill per member, in the composer CONTEXT BAR) ──
   "Whose grants is this turn using" — NOT the membership pills (which answer
   "where does this chat belong"). The pills live in .chat-cw-context-bar, the
   input-area-owned row ABOVE the textarea, so the composer's bottom-row
   stacking rules no longer apply to them.

   DELIBERATE DIVERGENCE from the mode selector: the group is NOT hidden under
   an active assistant. Picking a persona replaces the mode, but it does not
   change which grants the turn resolves against — hiding the pills there
   would conceal a security-relevant fact exactly when an assistant is acting. */
.chat-active-target-group {
    display: inline-flex; align-items: center;
    flex-wrap: wrap; gap: 6px;
    min-width: 0;
}

.chat-active-target {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px; border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--text-primary) 8%, transparent);
    background: color-mix(in srgb, var(--text-primary) 4%, transparent);
    color: var(--text-muted);
    font-size: var(--fs-ui); line-height: var(--lh-body); white-space: nowrap;
    max-width: 220px;
    cursor: pointer; transition: color 0.15s, border-color 0.15s;
}
.chat-active-target .chat-active-target-label {
    overflow: hidden; text-overflow: ellipsis;
}
.chat-active-target:hover {
    color: var(--text-primary);
    border-color: color-mix(in srgb, var(--text-primary) 16%, transparent);
}
.chat-active-target:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--text-primary) 40%, transparent);
    outline-offset: 2px;
}
/* A narrowed (project) scope is the one worth reading at a glance. */
.chat-active-target[data-state="project"] { color: var(--text-primary); }

/* The member color dot — project color when known, neutral otherwise.
   (A `[data-state="workspace"]` ring variant lived here until the lone
   "Workspace" pill was removed as a duplicate of the composer's workspace
   icon; the group renders project members only, so nothing can match it.) */
.chat-active-target-dot {
    width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto;
    background: color-mix(in srgb, var(--text-muted) 55%, transparent);
}

/* Per-pill ✕ — quiet until the pill is hovered; a small, honest affordance
   rather than a second button fighting the label for attention. */
.chat-active-target-remove {
    margin-left: 2px; padding: 0 2px;
    font-size: var(--fs-body); line-height: 1;
    color: color-mix(in srgb, var(--text-muted) 70%, transparent);
    border-radius: 50%;
    opacity: 0; transition: opacity 0.12s, color 0.12s;
}
.chat-active-target:hover .chat-active-target-remove,
.chat-active-target:focus-visible .chat-active-target-remove { opacity: 1; }
.chat-active-target-remove:hover { color: var(--text-primary); }

/* The "+N" overflow pill and the trailing "+" add affordance. */
.chat-active-target-more { font-weight: 600; }
.chat-active-target-add {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; padding: 0;
    border-radius: 50%;
    border: 1px dashed color-mix(in srgb, var(--text-muted) 45%, transparent);
    background: none; color: var(--text-muted);
    font-size: var(--fs-body-lg); line-height: 1; cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.chat-active-target-add:hover {
    color: var(--text-primary);
    border-color: color-mix(in srgb, var(--text-primary) 30%, transparent);
}

/* ── The orb's Space pill ─────────────────────────────────────────────────
   One pill naming the Space the assistant works in, with a chevron that says a
   click opens the Space chooser. "choose" is its resting state: nothing chosen
   yet, so the pill invites a choice instead of saying nothing. */
.chat-active-target[data-state="space"] { color: var(--text-primary); }
.chat-active-target[data-state="choose"] {
    border-style: dashed;
    border-color: color-mix(in srgb, var(--text-muted) 45%, transparent);
}
.chat-active-target-chevron {
    flex: 0 0 auto;
    margin-left: -2px;
    opacity: 0.7;
}
.chat-active-target:hover .chat-active-target-chevron { opacity: 1; }
