/* agentquality.css: the "Workflow quality" part of an agent's detail (agentquality.js). */
.aq-flow { display: grid; gap: var(--sv-space-2); padding: var(--sv-space-2) 0; border-bottom: var(--sv-hairline-w) solid var(--sv-hairline); min-width: 0; }
.aq-flow:last-of-type { border-bottom: 0; }
.aq-flow-head { display: grid; gap: 2px; }
.aq-flow-name { font-size: var(--ui-text); overflow-wrap: anywhere; }
.aq-stats { grid-template-columns: repeat(auto-fit, minmax(min(100%, 7rem), 1fr)); }
.aq-stats .agents-stat[data-empty] b { font-size: var(--ui-meta); font-weight: 500; color: var(--sv-ink-tertiary); }
.aq-stats .agents-stat[data-dim="wqs"] { background: var(--sv-fill-4); }
.aq-bad { margin: 0; font-size: var(--ui-meta); color: var(--sv-ink-secondary); }
.aq-bad[data-failed] { color: var(--sv-danger); }
.aq-more > summary { cursor: pointer; display: flex; align-items: center; gap: 4px; min-height: 32px; font-size: var(--ui-meta); color: var(--sv-ink-secondary); }
.aq-trend { width: 96px; height: 24px; flex: none; }
.aq-trend polyline { fill: none; stroke: var(--sv-ink-secondary); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.aq-weeks { margin-top: 4px; }
.aq-reasons, .aq-runs, .aq-facts { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; font-size: var(--ui-meta); }
.aq-reasons li { color: var(--sv-ink-secondary); overflow-wrap: anywhere; }
.aq-run { padding: var(--sv-space-2); border-radius: var(--sv-radius); background: var(--sv-surface-sunken); min-width: 0; }
.aq-run[data-state="failed"] { background: color-mix(in srgb, var(--sv-danger) 8%, transparent); }
.aq-run-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--sv-space-2); min-width: 0; }
.aq-state { font-weight: 600; }
.aq-run[data-state="failed"] .aq-state { color: var(--sv-danger); }
.aq-run-nums { flex: 1 1 18rem; min-width: 0; color: var(--sv-ink-secondary); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.aq-run-more > summary { cursor: pointer; min-height: 28px; display: flex; align-items: center; color: var(--sv-ink-tertiary); }
.aq-facts { padding-top: 4px; }
.aq-facts li { overflow-wrap: anywhere; }
.aq-facts a { color: var(--sv-ink); }
.aq-note { color: var(--sv-ink-tertiary); }
.aq-health[data-failed] { color: var(--sv-danger); }
.aq-issues { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.aq-issues .agents-ask[data-kind="attention"] { background: color-mix(in srgb, var(--sv-attention) 8%, transparent); }

@media (max-width: 640px) {
  .aq-weeks th:nth-child(4), .aq-weeks td:nth-child(4) { display: table-cell; }
  .aq-weeks th:nth-child(5), .aq-weeks td:nth-child(5), .aq-weeks th:nth-child(6), .aq-weeks td:nth-child(6) { display: none; }
  .aq-more > summary, .aq-run-more > summary { min-height: 44px; }
}

/* Evidence tier of a run's overall score: verified (acceptance, calibrated grade or a failure) or provisional. */
.aq-tier { font-size: var(--ui-meta); padding: 1px 8px; border-radius: 999px; background: var(--sv-fill-2); color: var(--sv-ink-secondary); }
.aq-tier[data-tier="verified"] { color: var(--ws-working-ink); }
.agents-stat[data-availability="not_applicable"] b, .agents-stat[data-availability="missing"] b { font-weight: 400; }
.aq-coverage[data-required="unknown"] { padding: 4px 8px; border-radius: var(--sv-radius); background: color-mix(in srgb, var(--sv-attention) 8%, transparent); }
