/* Team chats (frontend/chat/team-chat.js): several agents in one thread. */

/* An agent's or another person's message in a team room, Discord-like with ClawChats' spacing: avatar in a gutter,
   header line (name · owner · answering X · time), everything else in the text column. Follow-ups from the same author
   within 5 minutes (.team-msg--cont) have no header. Your own messages keep their bubble. */
.message.assistant.team-msg { --team-gutter: 36px; --team-gap: 12px; position: relative; display: grid; grid-template-columns: var(--team-gutter) minmax(0, 1fr); column-gap: var(--team-gap); justify-items: start; align-content: start; margin-top: 8px; }
.message.assistant.team-msg > * { grid-column: 2; max-width: 100%; }
.message.assistant.team-msg.team-msg--cont { margin-top: -4px; }
.team-author {
  position: relative;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  column-gap: 8px;
  row-gap: 2px;
  min-width: 0;
  margin-bottom: 2px;
  font-size: 15px;
  font-weight: 600;
  line-height: 22px;
  color: var(--text-strong, var(--text-primary));
}
.message.assistant.team-msg > .team-author + .message-content { margin-top: 0; }
.team-bar .chat-author-avatar,
.team-pop__row .chat-author-avatar,
.mention-menu .slash-menu-icon .chat-author-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  overflow: hidden;
  border-radius: 999px;
}
/* The avatar hangs in the gutter, its top level with the name. */
.team-author > .chat-author-avatar { position: absolute; top: 0; left: calc(-1 * (var(--team-gutter) + var(--team-gap))); display: inline-flex; width: var(--team-gutter); height: var(--team-gutter); overflow: hidden; border-radius: 999px; }
.team-author > .chat-author-avatar .chat-author-avatar__initials { font-size: 14px; }
.team-author__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-author__owner { font-size: 13px; font-weight: 400; color: var(--text-secondary); }
.team-author__for { flex: 0 0 auto; align-self: center; padding: 1px 6px; border: 1px solid var(--border-color); border-radius: 999px; font-size: 11px; font-weight: 500; line-height: 16px; color: var(--text-muted); }
.team-author__time { font-size: 12px; font-weight: 400; color: var(--text-muted); white-space: nowrap; }
/* A follow-up's time: in the gutter while hovered, as Discord does. Right-aligned against the text column's gap,
   running left into the padding when it's wider than the gutter; the header time's colour. */
.message.assistant.team-msg--cont > .message-hover-time { grid-column: 1; grid-row: 1; max-width: none; justify-self: end; justify-self: unsafe end; margin: 0 max(0px, calc(12px - var(--team-gap))) 0 0; font-size: 11px; line-height: 27px; color: var(--text-muted); white-space: nowrap; opacity: 0; transition: opacity 0.15s ease; }
.message.assistant.team-msg--cont:is(:hover, :focus-within) > .message-hover-time { opacity: 1; }
/* Actions float over the message's top right while it's hovered or focused (Discord's toolbar), so a group reads as one
   block. Touch and narrow screens keep the row in place, always visible (style.css). */
@media (hover: hover) and (min-width: 681px) {
  .message.assistant.team-msg > .message-actions { position: absolute; top: -14px; right: 8px; z-index: 2; margin: 0; padding: 2px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-primary); }
  .message.assistant.team-msg:not(:hover, :focus-within) > .message-actions:not(:has(.react-btn[aria-expanded="true"])) { opacity: 0; pointer-events: none; }
  .message.assistant.team-msg:is(:hover, :focus-within) > .message-actions { opacity: 1; }
  .message.assistant.team-msg > .message-actions .msg-action-btn { border-color: transparent; }
}
@media (max-width: 480px) {
  .message.assistant.team-msg { --team-gutter: 32px; --team-gap: 10px; }
  .team-author > .chat-author-avatar .chat-author-avatar__initials { font-size: 13px; }
}

/* Temporary bubble while an agent replies. */
.message.team-live .team-live__tool { font-size: 12px; color: var(--text-muted); }
.message.team-live .team-live__tool:empty { display: none; }
.message.team-live .team-live__waiting { margin: 2px 0 4px; font-size: 12px; color: var(--warning, #d9a441); }
.message.team-live .team-live__waiting:empty { display: none; }

/* Where a converted chat's earlier history ends. */
.team-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  font-size: 12px;
  color: var(--text-muted);
}
.team-divider::before,
.team-divider::after { content: ''; flex: 1; height: 1px; background: var(--border-color); }

/* A line in the room's timeline ("Kamil joined"): the same on every screen, like Discord's join and leave lines. */
.team-system {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 10px 0;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}
.team-system::before,
.team-system::after { content: ''; flex: 1; height: 1px; background: var(--border-color); opacity: 0.6; }
.team-system > span { max-width: 70%; }

/* A chat that ended for you (removed, left, ended, disconnected): its avatars dim, nothing in it is editable. */
.team-bar--ended .team-bar__trigger { opacity: 0.55; }
.team-pop__hint--over { color: var(--text-secondary); }

/* Header: a team chat's participants sit right after the title (the Control UI's members button
   follows the chat title). The title only takes its text's width; the bar takes the free space, so
   the header buttons on the right keep their places. Empty for normal chats. */
.header > .title { flex: 0 1 auto; min-width: 0; }
.team-bar { display: flex; align-items: center; flex: 1 1 0; min-width: 0; margin-left: -6px; }
.team-pop > summary { list-style: none; }
.team-pop > summary::-webkit-details-marker { display: none; }
.team-bar__trigger {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 6px;
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
}
.team-bar__trigger:hover,
.team-pop[open] > .team-bar__trigger { background: var(--bg-tertiary); color: var(--text-primary); }
.team-bar__trigger > svg { width: 18px; height: 18px; }
.team-bar__trigger > .chat-author-avatar { box-shadow: 0 0 0 2px var(--bg-primary); }
.team-bar__trigger > .chat-author-avatar + .chat-author-avatar { margin-left: -6px; }
.team-bar__more { margin-left: 4px; font-size: 11px; color: var(--text-muted); }

.team-pop__panel {
  width: 280px;
  max-width: calc(100vw - 24px);
  overflow-y: auto;
  padding: 6px;
  /* Same surface as the composer's context popover (openclaw-composer.css .context-usage__popover);
     the tokens come from composer-tokens.css, which scopes them to .team-bar. */
  background: var(--chat-composer-popover-background, var(--bg-elevated));
  border: 1px solid var(--chat-composer-popover-border, var(--overlay-border));
  border-radius: var(--chat-composer-popover-radius, var(--radius-lg));
  box-shadow: var(--overlay-shadow);
}
.team-pop__title {
  padding: 8px 8px 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.team-pop__row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 32px;
  padding: 4px 8px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text-primary);
  font: inherit;
  font-size: 13px;
  text-align: left;
}
.team-pop__add { cursor: pointer; }
.team-pop__add:hover { background: var(--bg-tertiary); }
.team-pop__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-pop__busy { font-size: 10px; color: var(--text-muted); animation: team-pulse 1.2s ease-in-out infinite; }
.team-pop__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
}
.team-pop__icon:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.team-pop__icon svg { width: 14px; height: 14px; }
.team-pop__toggle {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 6px;
  padding: 8px;
  border-top: 1px solid var(--border-color);
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
}
.team-pop__toggle input { margin-top: 2px; }
.team-pop__toggle small { display: block; font-size: 11px; color: var(--text-muted); }
.team-pop__rounds { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 10px 6px 34px; font-size: 12px; color: var(--text-secondary); }
.team-pop__rounds select { padding: 2px 6px; border: 1px solid var(--border-color); border-radius: 6px; background: var(--input-bg); color: var(--text-primary); font: inherit; }
.team-pop__hint { padding: 4px 8px 6px; font-size: 11px; color: var(--text-muted); }

/* Sidebar: team chats get a people mark before the title. */
.chat-team-icon { display: inline-flex; vertical-align: -2px; margin-right: 4px; color: var(--text-muted); }
.chat-team-icon svg { width: 13px; height: 13px; }

@keyframes team-pulse { 50% { opacity: 0.3; } }

/* Sidebar chat menu: "Add people or agents…" expands to the people and agents, indented under it. */
.chat-context-menu-title { padding: 6px 12px 2px; font-size: 11px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--text-muted); }
.chat-context-agents { padding-left: 18px; }
.chat-context-agents[hidden] { display: none; }
.chat-context-agent .chat-author-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
}
.team-pop__row > span[aria-hidden],
.chat-context-agent > span[aria-hidden] { display: inline-flex; }

/* A team chat with other people: who sees what's said (team-chat.js _teamRenderNotice). */
.team-notice { margin: 0 auto 6px; max-width: 100%; padding: 6px 12px; border-radius: 8px; background: var(--bg-tertiary); color: var(--text-muted); font-size: 12px; line-height: 1.4; }
.team-pop__name small { color: var(--text-muted); font-weight: 400; }

/* Sharing modal (sharing.js) */
.sharing-modal { max-width: 560px; }
.sharing-intro { margin: 0 0 12px; color: var(--text-muted); font-size: 13px; }
.sharing-card { margin: 8px 0 14px; padding: 12px 14px; border: 1px solid var(--border-color); border-radius: 10px; }
.sharing-card.focus { border-color: var(--text-muted); }
.sharing-card-title { font-weight: 600; color: var(--text-primary); }
.sharing-meta { margin-top: 2px; font-size: 12px; color: var(--text-muted); }
.sharing-fp { margin-top: 4px; font-family: var(--mono, ui-monospace, monospace); font-size: 11px; color: var(--text-muted); }
.sharing-verified { margin-left: 6px; font-family: var(--font-sans, inherit); color: var(--ok, var(--text-secondary)); }
.sharing-unverified { margin-left: 6px; font-family: var(--font-sans, inherit); color: var(--warn, var(--text-secondary)); }
.sharing-link { padding: 0; border: 0; background: none; color: var(--text-secondary); font: inherit; font-family: var(--font-sans, inherit); text-decoration: underline; cursor: pointer; }
.sharing-link:hover { color: var(--text-primary); }
.sharing-form { margin-top: 10px; }
.sharing-label { margin: 6px 0; font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.sharing-agent, .sharing-check { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; color: var(--text-primary); cursor: pointer; }
.sharing-agent .chat-author-avatar { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; overflow: hidden; border-radius: 999px; }
.sharing-check { align-items: flex-start; margin-top: 6px; }
.sharing-check small { display: block; color: var(--text-muted); font-size: 11px; }
.sharing-row { display: flex; gap: 12px; margin-top: 8px; font-size: 12px; color: var(--text-secondary); }
.sharing-row label { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.sharing-row label:has([data-cap]) { flex: 0 0 110px; }
.sharing-row select { width: 100%; min-width: 0; text-overflow: ellipsis; }
.sharing-row select, .sharing-row input { padding: 6px 8px; border: 1px solid var(--border-color); border-radius: 6px; background: var(--input-bg); color: var(--text-primary); font: inherit; }
.sharing-hint { margin-top: 8px; font-size: 11px; color: var(--text-muted); }
.sharing-footer { justify-content: flex-start; }
/* People (sharing.js): one card per person, both directions; the connect row and buttons are the
   settings page's own (settings-page.css) */
.people-connect .settings-row__control { display: flex; gap: 8px; flex: 0 1 340px; min-width: 0; }
.people-connect input { flex: 1; min-width: 0; height: 32px; padding: 0 12px; border: 1px solid var(--settings-line-strong, var(--border-color)); border-radius: 10px; background: var(--settings-control, var(--input-bg)); color: var(--text-primary); font: inherit; font-size: 12.5px; outline: none; }
#settingsView #sharingBody { display: flex; flex-direction: column; gap: 40px; } /* the page's gap between sections */
.people-list .sharing-card { margin: 0; }
.people-head { display: flex; align-items: center; gap: 10px; }
.people-head .chat-author-avatar { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; overflow: hidden; border-radius: 999px; flex-shrink: 0; }
.people-name { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.people-dir { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--settings-line, var(--border-color)); }
.people-dir .sharing-label { margin-top: 0; }
.people-line { font-size: 13px; color: var(--text-primary); }
.people-ask { font-size: 13px; color: var(--text-primary); }

/* A message that mentions you: marked at its left edge, tinted. No padding change: its avatar and text stay on the
   columns of every other message. */
.message.mentions-me { box-shadow: inset 3px 0 0 var(--mention-color); background: color-mix(in srgb, var(--mention-color) 6%, transparent); border-radius: 6px; }
.mention-pill--me { background: color-mix(in srgb, var(--mention-color) 30%, transparent); font-weight: 600; }
.team-pop__person small { margin-left: 4px; color: var(--text-muted); font-weight: 400; }

/* Requests waiting (sharing.js _sharingRenderAttention): sidebar banner and count badges. */
.people-banner { display: flex; flex-direction: column; gap: 8px; margin: 6px 10px 8px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--accent-color) 45%, var(--border-color)); border-radius: 12px; background: color-mix(in srgb, var(--accent-color) 10%, transparent); font-size: 13px; color: var(--text-primary); }
.people-banner small { color: var(--text-muted); }
.people-banner__actions { display: flex; gap: 6px; }
.people-banner__btn { padding: 4px 10px; border: 1px solid var(--border-color); border-radius: 8px; background: transparent; color: var(--text-primary); font: inherit; font-size: 12px; cursor: pointer; }
.people-banner__btn--primary { border-color: var(--accent-color); background: var(--accent-color); color: #fff; }
#cogBtn, [data-settings-section="agent-sharing"] { position: relative; }
.people-badge { position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--accent-color); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; pointer-events: none; }
[data-settings-section="agent-sharing"] .people-badge { position: static; margin-left: auto; }
.sharing-funnel-row { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; font-size: 12px; color: var(--text-secondary); }
.sharing-funnel { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; height: 32px; padding: 0 10px; border: 1px solid var(--settings-line-strong, var(--border-color)); border-radius: 10px; background: var(--settings-control, var(--input-bg)); color: var(--text-primary); font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; box-sizing: border-box; }
.sharing-funnel:hover { border-color: var(--text-secondary); }
.sharing-funnel:focus-visible { outline: 2px solid var(--accent, var(--text-secondary)); outline-offset: 1px; }
.sharing-funnel__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sharing-funnel__label--default { color: var(--text-secondary); }
.sharing-funnel__caret { color: var(--text-muted); font-size: 11px; }
.sharing-funnel__icon--new { border-style: dashed; border-color: var(--border-color); color: var(--text-muted); font-weight: 400; font-size: 13px; }
.sharing-funnel-menu { position: fixed; display: block; padding: 4px 0; }
.sharing-funnel-menu .chat-context-menu-item { display: flex; align-items: center; gap: 8px; width: 100%; }
.sharing-funnel-menu__check { margin-left: auto; color: var(--text-muted); }
.people-connect + .settings-row .settings-row__control { flex: 0 1 340px; min-width: 0; }
.sharing-error { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: rgba(220, 60, 60, 0.12); border: 1px solid rgba(220, 60, 60, 0.4); color: var(--text-primary); font-size: 12px; }
.sharing-keywarn { display: flex; align-items: center; gap: 12px; margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: rgba(220, 60, 60, 0.12); border: 1px solid rgba(220, 60, 60, 0.4); color: var(--text-primary); font-size: 12px; }
.sharing-keywarn__text { flex: 1; min-width: 0; }
.sharing-keywarn .settings-btn { flex: none; }
@media (max-width: 600px) { .sharing-keywarn { flex-direction: column; align-items: stretch; } }

/* ── Contact cards (contact-card.js): Settings → People list and one page per person ──
   Markup and classes from the approved mockup (plans/gateway-sharing-2026-11/mockups/contact-card.html); rows, groups,
   switches and segmented controls are the settings page's own (.settings-row, .settings-switch, .talk-segmented). */
.settings-page.cc-card-open > .settings-page__header { display: none; }
/* Status colours (the composer/approvals tokens), which the settings view doesn't define. */
#sharingBody, .team-pop__panel { --danger: #ef4444; --warn: #f59e0b; --ok: #22c55e; }
[data-theme="light"] #sharingBody, [data-theme="light"] .team-pop__panel { --danger: #b91c1c; --warn: #92400e; --ok: #166534; }
/* The card's sections keep the page's rhythm (#sharingBody gap) inside its body wrapper. */
#sharingBody .cc-body { display: flex; flex-direction: column; gap: 40px; }
#sharingBody .cc-body--accept { padding-bottom: 8px; }
.cc-back { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: var(--text-muted); font: inherit; font-size: 12.5px; font-weight: 550; cursor: pointer; }
.cc-back:hover, .cc-back:focus-visible { color: var(--text-primary); }
.cc-back svg { width: 14px; height: 14px; }
.cc-loading { padding: 24px 0; color: var(--text-muted); font-size: 13px; }

/* Header: the Control UI person card's header (person-activity-card.css), at page size */
.cc-head { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.cc-head .chat-author-avatar { display: inline-flex; width: 48px; height: 48px; flex: 0 0 auto; overflow: hidden; border-radius: 999px; }
.cc-head .chat-author-avatar__initials { font-size: 17px; }
.cc-head__text { display: grid; gap: 4px; min-width: 0; }
.cc-head__text .settings-page__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-head__status { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); min-width: 0; overflow-wrap: anywhere; }
.cc-dot { display: inline-block; width: 6px; height: 6px; border-radius: 999px; background: var(--ok); flex: 0 0 auto; vertical-align: middle; }
.cc-dot--off { background: var(--text-muted); }
.cc-pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border: 1px solid var(--settings-line-strong); border-radius: 999px; font-size: 11px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.cc-pill--ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.cc-pill--warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.cc-pill--danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.cc-pill--inline { margin-left: 6px; }
.cc-mono { font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace); font-size: 12px; color: var(--text-secondary); letter-spacing: 0.02em; overflow-wrap: anywhere; }

/* A setting with a choice: title, segmented control, then what the choice means */
#sharingBody .cc-choice { flex-direction: column; align-items: stretch; gap: 10px; }
.cc-choice .settings-row__control { justify-content: flex-start; max-width: 100%; flex-wrap: wrap; }
.cc-explain { font-size: 12.5px; line-height: 1.5; color: var(--text-secondary); }
.cc-explain b { color: var(--text-primary); font-weight: 600; }
.cc-banners { display: flex; flex-direction: column; gap: 10px; }
.cc-callout { display: flex; gap: 10px; margin: 0; padding: 10px 12px; border: 1px solid; border-radius: 10px; font-size: 12.5px; line-height: 1.5; color: var(--text-primary); }
.settings-row .cc-callout { margin: 0; }
.cc-callout > svg { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 1px; }
.cc-callout--warn { border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.cc-callout--warn > svg { color: var(--warn); }
.cc-callout--danger { border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: color-mix(in srgb, var(--danger) 9%, transparent); }
.cc-callout--danger > svg { color: var(--danger); }
.cc-callout--info { border-color: color-mix(in srgb, var(--accent-color) 40%, transparent); background: color-mix(in srgb, var(--accent-color) 10%, transparent); }
.cc-callout--info > svg { color: var(--accent-text); }
.cc-callout code { font-family: var(--font-mono, ui-monospace, monospace); font-size: 11.5px; }
.cc-callout__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.cc-keys { margin: 8px 0 0; white-space: pre; overflow-x: auto; }

/* Agents they can use: chips */
.cc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cc-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px 0 6px; border: 1px solid var(--settings-line-strong); border-radius: 999px; background: var(--settings-control); color: var(--text-primary); font-size: 12.5px; cursor: pointer; max-width: 100%; }
.cc-chip input { accent-color: var(--accent-color); margin: 0; }
.cc-chip .chat-author-avatar { display: inline-flex; width: 18px; height: 18px; overflow: hidden; border-radius: 999px; flex: 0 0 auto; }
.cc-chip--off { color: var(--text-muted); }
.cc-chip small { color: var(--text-muted); font-size: 11px; }

/* Knowledge picker */
.cc-files { border: 1px solid var(--settings-line); border-radius: 12px; overflow: hidden; }
.cc-files__group { padding: 8px 12px 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); background: rgba(var(--ink), 0.03); }
.cc-file { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 6px 12px; border: 0; border-top: 1px solid var(--settings-line); background: none; font: inherit; font-size: 13px; color: var(--text-primary); text-align: left; cursor: pointer; }
.cc-file input[type="checkbox"] { accent-color: var(--accent-color); margin: 0; }
.cc-file__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-file__meta { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }
.cc-file--add { color: var(--text-secondary); }
.cc-file--add:hover, .cc-file--add:focus-visible { background: rgba(var(--ink), 0.04); }
.cc-file--empty { color: var(--text-muted); cursor: default; font-size: 12.5px; }
.cc-file--input { cursor: default; flex-wrap: wrap; }
.cc-file--input .settings-input, .cc-basic__repos .settings-input, .cc-inline-input .settings-input { flex: 1 1 220px; min-width: 0; }
.cc-inline-input { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; width: 100%; }
.cc-never { font-size: 11.5px; color: var(--text-muted); }
.cc-sync { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-muted); }
.cc-disabled { opacity: 0.5; pointer-events: none; }

/* Usage meter (the old "N of 50 replies today") */
.cc-meter { height: 6px; border-radius: 999px; background: rgba(var(--ink), 0.08); overflow: hidden; }
.cc-meter > span { display: block; height: 100%; border-radius: inherit; background: var(--accent-color); }
.cc-usage { display: grid; gap: 6px; font-size: 12px; color: var(--text-muted); }
.cc-usage b { color: var(--text-primary); font-weight: 600; }

/* Free text */
#sharingBody .cc-text { flex-direction: column; align-items: stretch; gap: 8px; }
.cc-textarea { width: 100%; min-height: 64px; padding: 8px 10px; border: 1px solid var(--settings-line-strong); border-radius: 10px; background: var(--settings-control); color: var(--text-primary); font: inherit; font-size: 13px; line-height: 1.45; resize: vertical; outline: none; box-sizing: border-box; }
.cc-textarea:focus-visible { border-color: var(--accent-color); }
.cc-textarea::placeholder { color: var(--text-muted); }

/* Chats with them: Control UI person card "Recent sessions" rows */
.cc-session { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 16px; border: 0; background: none; color: var(--text-primary); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.cc-session + .cc-session, .cc-session + .settings-row, .settings-row + .cc-session { border-top: 1px solid var(--settings-line); }
.cc-session:hover, .cc-session:focus-visible { background: rgba(var(--ink), 0.04); }
.cc-session svg { width: 15px; height: 15px; color: var(--text-muted); flex: 0 0 auto; }
.cc-session__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-session__age { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.cc-session--all { color: var(--text-secondary); font-size: 12.5px; }

/* First-time accept: actions stay in reach */
.cc-sticky { position: sticky; bottom: 0; z-index: 2; display: flex; justify-content: flex-end; gap: 8px; margin: 0 -16px; padding: 12px 16px; border-top: 1px solid var(--settings-line); background: var(--bg-primary); }

/* People list rows */
.cc-person { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 16px; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.cc-person + .cc-person { border-top: 1px solid var(--settings-line); }
.cc-person:hover, .cc-person:focus-visible { background: rgba(var(--ink), 0.04); }
.settings-group > .cc-person:first-child { border-top-left-radius: inherit; border-top-right-radius: inherit; }
.settings-group > .cc-person:last-child { border-bottom-left-radius: inherit; border-bottom-right-radius: inherit; }
.cc-person .chat-author-avatar { display: inline-flex; width: 32px; height: 32px; overflow: hidden; border-radius: 999px; flex: 0 0 auto; }
.cc-person .chat-author-avatar__initials { font-size: 12px; }
.cc-person__text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.cc-person__name { font-size: 14px; font-weight: 500; color: var(--text-primary); display: flex; align-items: center; gap: 6px; min-width: 0; }
.cc-person__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-person__sub { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-person__sub .cc-dot { margin-right: 4px; }
.cc-chev { color: var(--text-muted); width: 16px; height: 16px; flex: 0 0 auto; }

/* What they can make your agents use */
.cc-tag { display: inline-flex; align-items: center; margin-left: 6px; padding: 0 6px; border-radius: 999px; font-size: 10.5px; font-weight: 600; vertical-align: 1px; white-space: nowrap; }
.cc-tag--na { color: var(--text-muted); background: rgba(var(--ink), 0.05); font-weight: 500; }
.cc-cmd { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border: 1px solid var(--settings-line-strong); border-radius: 7px; background: var(--settings-control); font-family: var(--font-mono, ui-monospace, monospace); font-size: 11.5px; color: var(--text-primary); }
.cc-cmd--add { font-family: inherit; color: var(--text-muted); border-style: dashed; cursor: pointer; }
.cc-cmd__x { display: inline-flex; padding: 0; border: 0; background: none; color: var(--text-muted); cursor: pointer; }
.cc-cmd__x:hover, .cc-cmd__x:focus-visible { color: var(--text-primary); }
.cc-legend { font-size: 12px; line-height: 1.7; color: var(--text-muted); margin-bottom: 8px; }
.cc-layer { display: inline-flex; align-items: center; margin-left: 4px; padding: 0 6px; height: 17px; border-radius: 5px; font-size: 10.5px; font-weight: 600; vertical-align: 1px; white-space: nowrap; border: 1px solid; }
.cc-layer--chat { color: var(--mention-color); border-color: color-mix(in srgb, var(--mention-color) 35%, transparent); }
.cc-layer--copy { color: var(--accent-text); border-color: color-mix(in srgb, var(--accent-color) 40%, transparent); }
.cc-layer--exec { color: var(--text-secondary); border-color: var(--settings-line-strong); }
.cc-layer--prompt { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.cc-basic { border: 1px solid var(--settings-line); border-radius: 12px; overflow: hidden; font-size: 12.5px; }
.cc-basic__head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: space-between; padding: 6px 12px; background: rgba(var(--ink), 0.03); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
.cc-basic__head .settings-btn { height: 26px; text-transform: none; letter-spacing: 0; }
.cc-basic__btns { display: inline-flex; gap: 6px; }
.cc-basic__row { display: grid; grid-template-columns: minmax(150px, 34%) 1fr; gap: 12px; padding: 5px 12px; border-top: 1px solid var(--settings-line); color: var(--text-secondary); }
.cc-basic__row--edit { grid-template-columns: minmax(110px, 30%) 1fr auto; align-items: center; gap: 8px; }
.cc-basic__row code, .cc-basic__never code, .cc-tool code, .cc-skill code { font-family: var(--font-mono, ui-monospace, monospace); font-size: 11.5px; color: var(--text-primary); overflow-wrap: anywhere; }
.cc-basic__repos { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--settings-line); color: var(--text-muted); font-size: 12px; }
.cc-basic__repos .cc-legend { margin: 0; }
.cc-basic__never { padding: 8px 12px; border-top: 1px solid var(--settings-line); color: var(--text-muted); font-size: 12px; line-height: 1.6; }
.cc-toolgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 16px; }
.cc-toolgrp__t { margin-bottom: 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); display: flex; align-items: center; }
.cc-toolgrp__items { display: grid; gap: 2px; }
.cc-tool { display: flex; align-items: center; gap: 8px; min-height: 24px; cursor: pointer; }
.cc-tool input { margin: 0; accent-color: var(--accent-color); }
.cc-tool small { color: var(--text-muted); font-size: 11px; }
.cc-tool--off code { color: var(--text-muted); }
.cc-tool--locked { cursor: default; }
.cc-skills { display: grid; gap: 6px; }
.cc-skill { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; cursor: pointer; }
.cc-skill small { color: var(--text-muted); font-size: 11.5px; flex: 1 1 200px; min-width: 0; }
.cc-skill--more { padding: 0 0 0 42px; border: 0; background: none; font: inherit; color: var(--text-secondary); font-size: 12.5px; text-align: left; }
.cc-skill--more:hover, .cc-skill--more:focus-visible { color: var(--text-primary); }

/* New-chat picker: shared agents, the owner tight under the name (as the @ menu's rows), avatar centred on both lines. */
.chat-folder-menu .team-picker .session-menu__item:has(.session-menu__sub) { display: grid; grid-template-columns: 20px minmax(0, 1fr) 14px; grid-template-rows: auto auto; align-content: center; column-gap: 8px; row-gap: 2px; padding: 5px 8px; line-height: 1.25; }
.chat-folder-menu .team-picker .session-menu__item:has(.session-menu__sub) .session-menu__icon { grid-row: 1 / 3; align-self: center; width: 20px; height: 20px; margin-left: -3px; } /* lines up with Your agents' avatars (agents.css) */
.chat-folder-menu .team-picker .session-menu__item:has(.session-menu__sub) .session-menu__text { grid-column: 2; grid-row: 1; font-size: 14px; }
.chat-folder-menu .team-picker .session-menu__item:has(.session-menu__sub) .session-menu__sub { grid-column: 2; grid-row: 2; font-size: 12px; }
.chat-folder-menu .team-picker .session-menu__item:has(.session-menu__sub) .session-menu__check { grid-column: 3; grid-row: 1 / 3; align-self: center; }
.team-picker .chat-author-avatar { display: inline-flex; width: 20px; height: 20px; overflow: hidden; border-radius: 999px; }
/* One name size in the picker: Your agents as Shared with you. */
.chat-folder-menu:has(.team-picker) .session-menu__item .session-menu__text { font-size: 14px; }
.team-picker__sep { height: 1px; margin: 6px 4px; background: var(--border-color); }

/* Popover: people, each with their agents */
.team-pop__person-head { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 4px 8px; color: var(--text-primary); font-size: 13px; font-weight: 600; }
.team-pop__person-head .chat-author-avatar { display: inline-flex; width: 20px; height: 20px; overflow: hidden; border-radius: 999px; flex: 0 0 auto; }
.team-pop__person-head .team-pop__name small { font-weight: 400; }
.team-pop__agents { padding: 0 0 4px 28px; }
.team-pop__agents .team-pop__row { min-height: 28px; }
.team-pop__agent { display: flex; align-items: center; gap: 8px; min-height: 28px; padding: 2px 8px; font-size: 13px; color: var(--text-primary); }
.team-pop__agent .chat-author-avatar { display: inline-flex; width: 18px; height: 18px; overflow: hidden; border-radius: 6px; flex: 0 0 auto; }
.team-pop__gw { padding: 2px 8px; font-size: 11px; color: var(--text-muted); }
.team-pop__expand { color: var(--text-secondary); }
.team-pop__expand .team-pop__icon { width: 18px; height: 18px; }
.team-pop__expand[aria-expanded="true"] { color: var(--text-primary); }
/* "Invite someone…": the picker's ⊕ in the avatar slot, so its text lines up with the rows above. */
.team-pop__lead { flex: 0 0 auto; align-items: center; justify-content: center; width: 20px; height: 20px; color: var(--text-secondary); }
.team-pop__lead svg { width: 16px; height: 16px; }
.team-pop__two { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.team-pop__two small { color: var(--text-muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-pop__sep { height: 1px; margin: 6px 0; background: var(--border-color); }
.team-pop__open { opacity: 0.7; }

@media (max-width: 768px) {
  .cc-head .chat-author-avatar { width: 40px; height: 40px; }
  .cc-file__meta { display: none; }
}
@media (max-width: 520px) {
  .cc-ex > span { flex-basis: 100%; }
  #sharingBody .settings-row__text { flex: 1 1 100%; }
  #sharingBody .settings-row__control { justify-content: flex-start; flex-wrap: wrap; }
  #sharingBody .settings-row__control .sharing-funnel { width: 100%; }
  .cc-basic__row { grid-template-columns: 1fr; gap: 2px; }
  .cc-basic__row--edit { grid-template-columns: 1fr auto; }
  .cc-basic__row--edit input[data-k="argPattern"] { grid-column: 1; }
  .cc-toolgrid { grid-template-columns: 1fr 1fr; }
}

/* @ menu, Discord-style: name + AGENT badge over whose it is (mockup-room-1, panel 3). */
.mention-menu .slash-menu-item { min-height: 42px; padding-top: 4px; padding-bottom: 4px; }
.mention-menu .slash-menu-copy { grid-template-columns: minmax(0, 1fr); gap: 1px; }
.mention-menu .slash-menu-desc { text-align: left; font-size: 12px; color: var(--text-secondary); }
.mention-menu .slash-menu-name { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: 14px; } /* over the 12px owner */
.mention-menu__badge { flex: 0 0 auto; padding: 0 5px; border-radius: 4px; background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); font-size: 10px; font-weight: 700; letter-spacing: 0.04em; line-height: 16px; text-transform: uppercase; }
/* A posted mention of an agent: its avatar and name, never the handle. */
.mention-pill--agent { display: inline-flex; align-items: center; gap: 4px; vertical-align: baseline; }
.mention-pill--agent .chat-author-avatar { display: inline-flex; width: 16px; height: 16px; flex: 0 0 16px; overflow: hidden; border-radius: 999px; font-size: 8px; }
