/* Agent pages — 26/09/2026 ergonomics pass.
   The breadcrumb shared by every agent page, and the agent page itself read
   top-down: who the agent is (the banner), the task, the latest results, and
   the technical details folded at the end. Application tokens only. */

/* --- breadcrumb (« Agents › … ») --------------------------------------- */
.forge-shell .page-breadcrumb {
  margin: 0 0 14px;
  font-size: 13px;
}
.forge-shell .page-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.forge-shell .page-breadcrumb li { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.forge-shell .page-breadcrumb li + li::before {
  content: "›";
  color: var(--tx-4);
  font-size: 15px;
  line-height: 1;
}
.forge-shell .page-breadcrumb a {
  color: var(--accent-text);
  font-weight: 650;
  text-decoration: none;
  border-radius: var(--r-xs);
}
.forge-shell .page-breadcrumb a:hover { text-decoration: underline; }
.forge-shell .page-breadcrumb a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.forge-shell .page-breadcrumb [aria-current="page"] {
  color: var(--tx-2);
  overflow-wrap: anywhere;
}

/* --- the task -------------------------------------------------------- */
.forge-shell #agents-invoke-view #ai-form-wrap {
  display: grid;
  gap: 20px;
  min-width: 0;
}
.forge-shell .agent-task-card { display: grid; }
.forge-shell .agent-task-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
  padding: 18px 20px 20px;
}
.forge-shell .agent-task-field { display: grid; align-content: start; gap: 6px; min-width: 0; }
.forge-shell .agent-task-field-wide { grid-column: 1 / -1; }
.forge-shell #agents-invoke-view .agent-context-picker > label,
.forge-shell .agent-task-label {
  margin: 0;
  color: var(--tx-2);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: normal;
  text-transform: none;
}
.forge-shell .agent-task-scope {
  margin: 0;
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper);
  color: var(--tx);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.forge-shell #agents-invoke-view .agent-context-picker-control {
  display: flex;
  gap: 8px;
  min-width: 0;
}
.forge-shell #agents-invoke-view #ai-client-context-select {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--tx);
  font: inherit;
  font-size: 13px;
  text-overflow: ellipsis;
}
.forge-shell #agents-invoke-view .agent-context-manage { flex: 0 0 auto; min-height: 40px; }
.forge-shell .agent-task-types {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.forge-shell .agent-task-types .mode-chip {
  min-height: 36px;
  padding: 7px 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--card);
  color: var(--tx);
  font-size: 12.5px;
  font-weight: 600;
}
.forge-shell .agent-task-types .mode-chip.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-soft-ink);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.forge-shell .agent-task-types .mode-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.forge-shell #agents-invoke-view #ai-question {
  width: 100%;
  min-height: 104px;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--tx);
  font: inherit;
  font-size: 13.5px;
  line-height: 1.5;
}
.forge-shell #agents-invoke-view #ai-question:focus-visible { outline: 2px solid var(--accent-line); border-color: var(--accent); }
/* The main button spans the task; its label is never cut. */
.forge-shell .agent-task-run {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 44px;
  justify-content: center;
  white-space: normal;
  font-size: 13.5px;
}

/* --- latest results --------------------------------------------------- */
.forge-shell .agent-results { display: grid; gap: 10px; min-width: 0; }
.forge-shell .agent-results-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
}
.forge-shell #agents-invoke-view #ai-run-layout { min-height: 460px; }

/* --- technical details, last and folded (administrators only) ----------- */
.forge-shell #ai-form-wrap > .agent-mode-technical {
  margin: 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  color: var(--tx-2);
}
.forge-shell #ai-form-wrap > .agent-mode-technical > summary {
  color: var(--tx-2);
  font-size: 12.5px;
}
.forge-shell #ai-form-wrap > .agent-mode-technical .agent-mode-meta-item {
  border-color: var(--line-2);
  background: var(--paper);
  color: var(--tx-2);
  font-family: var(--mono);
  font-size: 11.5px;
}

@media (max-width: 760px) {
  .forge-shell .agent-task-body { grid-template-columns: 1fr; padding: 14px 16px 16px; }
  .forge-shell #agents-invoke-view .agent-context-picker-control { flex-wrap: wrap; }
}

/* --- a Torus catalogue's formats (26/09/2026): grouped by function, the
   admitted forms of the chosen one, the retired ones with their reason ---- */
.forge-shell .agent-task-types:has(.agent-format-group) { display: grid; gap: 12px; }
.forge-shell .agent-format-group,
.forge-shell .agent-format-forms { display: grid; gap: 6px; min-width: 0; }
.forge-shell .agent-format-modes { display: flex; flex-wrap: wrap; gap: 8px; }
.forge-shell .agent-format-group-label {
  margin: 0;
  color: var(--tx-3);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.forge-shell .agent-format-group-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.forge-shell .agent-format-forms {
  padding: 10px 12px;
  border: 1px solid var(--accent-line);
  border-radius: var(--r-sm);
  background: var(--accent-soft);
}
.forge-shell .agent-format-retired { color: var(--tx-3); font-size: 12.5px; }
.forge-shell .agent-format-retired summary { cursor: pointer; font-weight: 650; }
.forge-shell .agent-format-retired summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-xs); }
.forge-shell .agent-format-retired ul { display: grid; gap: 4px; margin: 6px 0 0; padding-left: 18px; }
.forge-shell .agent-format-retired-name { color: var(--tx-2); font-weight: 600; }
.forge-shell .agent-format-retired-reason { color: var(--tx-3); }

/* 27/09/2026 (recette D+E): an administrator sees how to unfold the
   technical details — a full-width row, its hint, « Afficher / Masquer ». */
.forge-shell #ai-form-wrap > .agent-mode-technical > .agent-technical-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  width: 100%;
  list-style: none;
  cursor: pointer;
  color: var(--tx);
  font-size: 13.5px;
}
.forge-shell #ai-form-wrap > .agent-mode-technical > .agent-technical-summary::-webkit-details-marker { display: none; }
.forge-shell #ai-form-wrap .agent-technical-title { font-weight: 650; }
.forge-shell #ai-form-wrap .agent-technical-hint { color: var(--tx-3); font-size: 12.5px; }
.forge-shell #ai-form-wrap .agent-technical-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 5px 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 650;
}
.forge-shell #ai-form-wrap .agent-technical-summary:hover .agent-technical-toggle { background: var(--accent-soft); }
.forge-shell #ai-form-wrap .agent-technical-summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--r-sm); }
.forge-shell #ai-form-wrap .agent-mode-technical .agent-technical-hide,
.forge-shell #ai-form-wrap .agent-mode-technical[open] .agent-technical-show { display: none; }
.forge-shell #ai-form-wrap .agent-mode-technical[open] .agent-technical-hide { display: inline; }
.forge-shell #ai-form-wrap .agent-mode-technical[open] .agent-technical-toggle svg { transform: rotate(180deg); }
