/* ================================================================
   agent-canvas.css — compact agent editor (maintainer 2026-07-23)
   Built on the app design tokens (css/reset.css) and the modal type
   scale (--arch-fs-* on .arch-view). Each agent is a compact row that
   is COLLAPSED by default (one-line summary) and expands on click to
   reveal the editor. Replaces the old always-expanded "operator" cards.
   ================================================================ */

/* The canvas replaces the legacy grid as the visible editor. */
#archAgentGrid { display: none; }

.arch-canvas-host {
  /* Sits inside .arch-agents-col, so no horizontal margin of its own. */
  margin: 0;
  min-width: 0;
}

.agent-rows {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

/* ── Compact agent row ───────────────────────────────────── */
.agent-row {
  background: var(--white, #fff);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.agent-row:hover { box-shadow: 0 3px 12px rgba(53, 32, 26, .08); }
.agent-row.ar-open { box-shadow: 0 5px 18px rgba(53, 32, 26, .10); }

/* Role color rail. */
.agent-row[data-role="deep-reader"]      { border-left-color: var(--gold); }
.agent-row[data-role="web-researcher"]   { border-left-color: #42a5f5; }
.agent-row[data-role="cross-referencer"] { border-left-color: #66bb6a; }
.agent-row[data-role="contrarian"]       { border-left-color: #ef5350; }
.agent-row[data-role="custom"]           { border-left-color: #ab47bc; }

.ar-head {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 11px;
  cursor: pointer;
}
.ar-n {
  width: 20px; height: 20px; flex-shrink: 0;
  border-radius: 5px;
  background: var(--cream-dark, #f0ebe3);
  color: var(--brown);
  font-size: var(--arch-fs-xs, .64rem); font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.ar-role {
  font-size: var(--arch-fs-sm, .7rem); font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.ar-meta {
  font-size: var(--arch-fs-xs, .64rem); color: var(--text-muted);
  margin-left: auto;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}
.ar-no-tools {
  display: inline-block; margin-left: 4px;
  font-size: var(--arch-fs-xs, .64rem); font-weight: 600;
  color: #8a1c1c; background: rgba(183, 28, 28, .10);
  border: 1px solid rgba(183, 28, 28, .35);
  border-radius: 999px; padding: 0 6px; white-space: nowrap; cursor: help;
}
.ar-x {
  flex-shrink: 0;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: var(--arch-fs-base, .74rem); line-height: 1;
  width: 20px; height: 20px; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  transition: color .15s, background .15s;
}
.ar-x:hover { color: #ef5350; background: rgba(239, 83, 80, .10); }
.ar-chev {
  flex-shrink: 0;
  color: var(--text-muted); font-size: var(--arch-fs-sm, .7rem);
}

/* ── Expanded editor body ────────────────────────────────── */
.ar-body {
  padding: 4px 11px 12px;
  border-top: 1px solid var(--border-light);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px 12px;
}
.ar-body .f { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ar-body .f.full { grid-column: 1 / -1; }
.ar-body label {
  font-size: var(--arch-fs-xs, .64rem); color: var(--text-muted); font-weight: 600;
}
.ar-body select,
.ar-body textarea {
  font-family: var(--sans); font-size: var(--arch-fs-xs, .64rem);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 6px; background: var(--cream); color: var(--text);
}
.ar-body textarea { resize: vertical; min-height: 40px; }
.ar-body .f.full input[type="range"] { accent-color: var(--accent); width: 140px; vertical-align: middle; }
.ar-body .op-val {
  font-size: var(--arch-fs-xs, .64rem); color: var(--text); font-weight: 600; margin-left: 6px;
}
.op-dev-note {
  display: inline-block; margin-left: 6px;
  font-size: var(--arch-fs-xs, .64rem); font-weight: 600; color: #2d7c4a;
}

/* Tool chips — a checkbox styled as a toggle pill. */
.tools { display: flex; flex-wrap: wrap; gap: 5px; }
.ar-tool {
  position: relative;
  display: inline-flex; align-items: center;
  font-size: var(--arch-fs-xs, .64rem);
  border: 1px solid var(--border); border-radius: 20px;
  padding: 2px 9px; cursor: pointer;
  color: var(--text-muted); background: var(--cream);
  transition: background .12s, border-color .12s, color .12s;
}
.ar-tool input {
  position: absolute; opacity: 0; width: 0; height: 0; margin: 0; pointer-events: none;
}
.ar-tool.on {
  background: #eef4ec; border-color: #bcd6bd; color: var(--ok, #2e7d46);
}
.ar-tool-gated { opacity: .55; cursor: not-allowed; }
.ar-tool-gated input { cursor: not-allowed; }
.op-tool-gated-note {
  font-size: var(--arch-fs-xs, .62rem); color: var(--text-muted); font-style: italic;
}

/* Developer-mode greying (shared token from architect.css). */
.arch-dev-disabled { opacity: .5; pointer-events: none; }
.arch-dev-disabled select { cursor: not-allowed; }
