/* ── Right panel ── */
.v10-panel-right {
  height: 100%;
  min-height: 0;
  flex-shrink: 0;
  background: var(--bg-panel);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.v10-agent-mode-tabs {
  height: var(--tab-h);
  min-height: var(--tab-h);
  display: flex;
  align-items: center;
  padding: 0 8px;
  border-bottom: 1px solid var(--border-subtle);
  gap: 2px;
}
.v10-agent-mode-tab {
  padding: 4px 14px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  transition: all 0.15s;
}
.v10-agent-mode-tab:hover { color: var(--text-secondary); background: var(--bg-hover); }
.v10-agent-mode-tab.active { color: var(--text-primary); background: var(--bg-active); }
.v10-agent-content { flex: 1; overflow-y: auto; }

/* Agent onboarding (stage 0) */
.v10-agent-onboarding { padding: 24px 16px; }
.v10-agent-onboarding-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.v10-agent-onboarding-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}
/* Agent tab */
.v10-agents-tab {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.v10-agents-tab > .v10-agent-add-surface {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
}
/* Network / Sessions tabs: simple padded scroll container (PR1 restored
   the padding that was removed when .v10-agents-tab became a flex column). */
.v10-agent-scroll-tab {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Network tab collapsible peer groups (Connected / Disconnected). */
.v10-peer-group {
  display: flex;
  flex-direction: column;
}
.v10-peer-group-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 4px;
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.15s;
}
.v10-peer-group-header:hover {
  color: var(--text-primary);
}
.v10-peer-group-header:focus-visible {
  outline: none;
  color: var(--text-primary);
}
.v10-peer-group-chevron {
  flex-shrink: 0;
  transition: transform 0.15s;
}
.v10-peer-group-chevron.expanded {
  transform: rotate(90deg);
}
.v10-peer-group-label {
  flex: 1;
}
.v10-peer-group-count {
  color: var(--text-tertiary);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.v10-peer-group-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 0 8px;
}
@media (prefers-reduced-motion: reduce) {
  .v10-peer-group-chevron { transition: none; }
}
.v10-agents-summary {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0; margin-bottom: 8px;
  font-size: 12px; color: var(--text-secondary);
}
.v10-agents-stat { display: flex; align-items: center; gap: 4px; }
.v10-agents-stat-dot { width: 6px; height: 6px; border-radius: 50%; }
.v10-agents-stat-dot.connected { background: var(--accent-green); }
.v10-agents-stat-dot.known { background: var(--text-tertiary); }
.v10-agents-stat-dot.offline { background: var(--accent-red); }
.v10-agents-stat-dot.degraded { background: #f59e0b; }
.v10-agents-refresh {
  margin-left: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 6px;
}
.v10-agents-refresh:hover { background: var(--bg-elevated); color: var(--text-primary); }
.v10-agents-refresh.disconnect {
  margin-left: 0;
  color: var(--text-danger);
  border-color: color-mix(in srgb, #ef4444 35%, var(--border-subtle));
}
.v10-agents-refresh.disconnect:hover {
  color: var(--text-danger-hover);
  background: color-mix(in srgb, #ef4444 10%, var(--bg-elevated));
}
.v10-agent-subtabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-panel);
  flex-shrink: 0;
}
.v10-agent-subtab-group {
  display: inline-flex;
  align-items: stretch;
  position: relative;
  border-radius: 4px;
  overflow: visible;
}
.v10-agent-subtab-group.active {
  background: var(--bg-active);
}
.v10-agent-subtab-group.active > .v10-agent-subtab.active {
  background: transparent;
  border-right-color: transparent;
  border-radius: 4px 0 0 4px;
  padding-right: 8px;
}
.v10-agent-subtab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 4px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.v10-agent-subtab:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.v10-agent-subtab.active {
  color: var(--text-primary);
  background: var(--bg-active);
  border-color: var(--border-subtle);
}
.v10-agent-subtab.add {
  min-width: 32px;
  justify-content: center;
  padding: 0 12px;
  font-size: 16px;
  line-height: 1;
}
.v10-agents-summary-active {
  gap: 10px;
  flex-wrap: wrap;
}
.v10-agents-status-detail {
  font-size: 10px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}
.v10-agents-loading { padding: 16px; color: var(--text-tertiary); font-size: 12px; text-align: center; }
.v10-agents-section-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-tertiary); margin: 12px 0 6px; padding: 0 2px;
}
.v10-agent-add-surface { padding-top: 8px; }
.v10-agent-card {
  padding: 10px 12px; border-radius: 6px; margin-bottom: 4px;
  border: 1px solid var(--border-subtle); background: var(--bg-surface);
  transition: background 0.15s;
}
.v10-agent-card:hover { background: var(--bg-elevated); }
.v10-agent-card.self { border-color: var(--accent-blue); border-left: 3px solid var(--accent-blue); }
.v10-agent-card-header { display: flex; align-items: center; gap: 6px; }
.v10-agent-card-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.v10-agent-card-dot.self { background: var(--accent-blue); }
.v10-agent-card-dot.connected { background: var(--accent-green); }
.v10-agent-card-dot.known { background: var(--text-tertiary); }
.v10-agent-card-dot.degraded { background: #f59e0b; }
.v10-agent-card-name { font-size: 12px; font-weight: 600; color: var(--text-primary); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v10-agent-card-badge {
  font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px;
  padding: 1px 5px; border-radius: 3px; flex-shrink: 0;
  background: var(--bg-elevated); color: var(--text-tertiary);
  border: 1px solid var(--border-subtle);
}
.v10-agent-card-meta {
  display: flex; gap: 8px; margin-top: 4px;
  font-size: 10px; color: var(--text-tertiary); font-family: var(--font-mono);
  flex-wrap: wrap;
}

/* Peer-axis Network-tab card — extends .v10-agent-card. The peer's
   name reads as a primary identifier (own line treatment via
   .v10-peer-card-name). Meta line: --text-secondary (identifying state,
   not decoration); we intentionally diverge from .v10-agent-card-meta's
   legacy tertiary here for AA on bg-elevated. */
.v10-peer-card-name {
  font-size: 12px; font-weight: 600; color: var(--text-primary);
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.v10-peer-card-meta {
  display: flex; gap: 8px; margin-top: 4px;
  font-size: 10px; color: var(--text-secondary); font-family: var(--font-mono);
  flex-wrap: wrap;
}
/* Override the legacy badge color to --text-secondary on peer cards
   (the badge carries identifying state — `direct` / `relayed` — not
   decoration; tertiary on bg-elevated is borderline AA). Scoped so the
   legacy Agents-tab cards keep their existing token. */
.v10-peer-card .v10-agent-card-badge { color: var(--text-secondary); }
/* Agents-as-chips inside each peer card. flex-wrap handles long lists
   gracefully; the +N more button toggles inline expansion (card grows
   vertically). Class is .v10-peer-chip (NOT .v10-agent-chip) — the
   latter is the attribution-pill component (~styles.css:5451) and the
   namespaces would collide. */
.v10-peer-card-chips {
  list-style: none; padding: 0; margin: 6px 0 0;
  display: flex; flex-wrap: wrap; gap: 4px;
}
.v10-peer-chip {
  display: inline-flex; align-items: center; gap: 4px;
  max-width: 140px;
  min-width: 0;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.v10-peer-chip-label {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* "+N more" / "Show less" toggle button. Shares the chip-pill geometry
   so it sits in the same row; one-tier-stronger border + transparent
   background distinguish it as interactive. No scoped :focus-visible —
   the global focus ring (styles.css:167) is the convention. */
.v10-peer-chip-more {
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--border-default);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.4;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.v10-peer-chip-more:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.v10-local-agent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.v10-local-agent-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  text-align: left;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.v10-local-agent-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-elevated);
}
.v10-local-agent-card.active {
  border-color: var(--accent-blue);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-blue) 42%, transparent);
}
.v10-local-agent-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.v10-local-agent-badge,
.v10-local-agent-status-pill {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-tertiary);
  display: inline-block;
  text-align: center;
}
.v10-local-agent-badge.chat_ready,
.v10-local-agent-status-pill.chat_ready {
  color: var(--text-success);
  border-color: color-mix(in srgb, var(--accent-green) 35%, var(--border-subtle));
}
.v10-local-agent-badge.connecting,
.v10-local-agent-status-pill.connecting {
  color: var(--text-info);
  border-color: color-mix(in srgb, var(--accent-blue) 35%, var(--border-subtle));
}
.v10-local-agent-badge.bridge_offline,
.v10-local-agent-status-pill.bridge_offline {
  color: var(--text-warning);
  border-color: color-mix(in srgb, #f59e0b 35%, var(--border-subtle));
}
.v10-local-agent-badge.degraded,
.v10-local-agent-status-pill.degraded {
  color: var(--text-warning);
  border-color: color-mix(in srgb, #f59e0b 35%, var(--border-subtle));
}
.v10-local-agent-badge.available,
.v10-local-agent-status-pill.available {
  color: var(--text-info);
  border-color: color-mix(in srgb, var(--accent-blue) 35%, var(--border-subtle));
}
.v10-local-agent-detail {
  margin-top: 12px;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--border-default);
  background: color-mix(in srgb, var(--bg-surface) 86%, var(--bg-elevated));
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.v10-local-agent-choice {
  margin-top: 0;
}
.v10-local-agent-chat-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative; /* anchor for the drop overlay */
}
.v10-local-agent-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.v10-local-agent-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
.v10-local-agent-subtitle {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.5;
}
.v10-local-agent-chat-shell > .v10-local-agent-notice,
.v10-local-agent-chat-shell > .v10-local-agent-error,
.v10-local-agent-chat-shell > .v10-local-agent-warning {
  margin: 8px 12px 0;
}
