/* e6a.css -- agentpaneel, een tab in het onderpaneel (S-0000-0326). Alle maten en
 * kleuren uit core.css' variabelen (var(--surface) enz.); geen eigen hex. Vorm: een
 * vaste linkerkolom (de slots) en een rechterkolom die meegroeit (het gesprek), zoals
 * AW_LISTW/agentview.wz op het canvas -- zie plan-e6a.md. De volle breedte van het
 * onderpaneel geeft het gesprek nu ruimte om code te lezen, in plaats van de kolom van
 * ~260px die de zijbalk toestond. */

.e6a-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

/* DE WERKBALK (DEC-0000-0140): Launch links, de engine voor nieuwe vragen rechts */
.e6a-toolbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--row-h);
  padding: 0 8px;
  border-bottom: 1px solid var(--rule);
}
.e6a-spacer { flex: 1; }
.e6a-englab { color: var(--text-dim); font-size: calc(var(--ui-fs) * 11 / 13); }
.e6a-launchbtn {
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0 8px;
  font-size: calc(var(--ui-fs) * 11 / 13);
  color: var(--text);
}
.e6a-launchbtn:hover, .e6a-launchbtn.on { background: var(--surface2); border-color: var(--text-dim); }
/* LAUNCH (e8a.js) klapt uit boven de grid, en schuift zelf als het meer is dan past */
.e6a-launch {
  flex: none;
  max-height: 45%;
  overflow-y: auto;
  border-bottom: 1px solid var(--rule);
}

/* S-0000-0217: welke engine nieuwe agentvragen krijgt -- de tools bestonden al
 * (agents_engines/agents_select), dit is alleen de keuzelijst. */
.e6a-engine {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--rule);
  border-radius: 2px;
  font-size: calc(var(--ui-fs) * 11 / 13);
  padding: 1px 4px;
  max-width: calc(var(--ui-fs) * 11);
}
.e6a-engine:focus { outline: none; border-color: var(--focus); }

/* LINKS DE GRID VAN ALLE AGENTS (agentmap.js), RECHTS HET GESPREK */
.e6a-body {
  flex: 1;
  display: flex;
  /* NOOIT WEGGEDRUKT door Launch: de grid en het gesprek houden minstens vier rijen */
  min-height: calc(var(--row-h) * 4);
}
.e6a-list {
  flex: 0 0 55%;
  min-width: 0;
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.e6a-grid { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
/* DE AANDACHTSLIJST ALLEEN ALS ER IETS WACHT: leeg nam hij twee rijen van de grid ("ATTENTION /
 * Nothing waiting"); een beantwoorde vraag blijft er wel in staan, om hem terug te vinden. */
.e6a-list .e6c-inline:has(.e6c-inlinelist > .e6c-empty) { display: none; }

/* DE TABS RECHTS: Conversation | Steps */
.e6a-tabs {
  flex: none;
  display: flex;
  gap: 14px;
  padding: 0 12px;
  height: var(--row-h);
  align-items: center;
  border-bottom: 1px solid var(--rule);
}
.e6a-tab {
  font-size: calc(var(--ui-fs) * 11 / 13);
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-dim);
  height: 100%;
  border-bottom: 1px solid transparent;
}
.e6a-tab.on { color: var(--text); border-bottom-color: var(--focus); }
.e6a-steps { flex: 1; overflow-y: auto; min-height: 0; padding: 6px 12px; }

.e6a-conv {
  flex: 1;
  min-width: 60px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.e6a-messages {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  min-height: 0;
}

.e6a-hint { color: var(--text-dim); font-size: var(--ui-fs); }

.e6a-status {
  font-size: var(--ui-fs);
  font-weight: 600;
  margin-bottom: 4px;
}
.e6a-status.run  { color: var(--attn); }
.e6a-status.ok   { color: var(--ok); }
.e6a-status.err  { color: var(--danger-tx); }
.e6a-status.idle { color: var(--text-dim); }

.e6a-question {
  color: var(--text-strong);
  white-space: pre-wrap;
  font-size: var(--ui-fs);
  margin-bottom: 6px;
}

.e6a-rule { border: none; border-top: 1px solid var(--rule); margin: 6px 0; }

.e6a-muted { color: var(--text-muted); font-size: var(--ui-fs); margin-bottom: 4px; }

.e6a-output {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  color: var(--text);
  font-size: var(--ui-fs);
  margin: 0;
}

.e6a-insert {
  align-self: flex-start;
  margin: 0 12px 8px;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 4px 10px;
  font-size: var(--ui-fs);
  cursor: pointer;
}
.e6a-insert:hover { background: var(--hover); }

/* S-0000-0352: the status strip docked above the input bar -- running count, elapsed
 * time, engine/model, a stop button. One row, small text, same family as e6a-listhead. */
.e6a-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-top: 1px solid var(--rule);
  font-size: calc(var(--ui-fs) * 11 / 13);
  color: var(--text-dim);
  flex: none;
}
.e6a-bardot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-dim); flex: none; }
.e6a-bardot.on { background: var(--ok); }
.e6a-barrun { color: var(--text); }
.e6a-barmodel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.e6a-bartime { margin-left: auto; }
.e6a-barqueue { color: var(--attn); }
.e6a-barstop {
  background: none;
  border: 1px solid var(--rule);
  color: var(--danger-tx);
  font-size: calc(var(--ui-fs) * 11 / 13);
  padding: 1px 8px;
  border-radius: 2px;
  cursor: pointer;
}
.e6a-barstop:hover { border-color: var(--danger); }

.e6a-bar {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  border-top: 1px solid var(--rule);
  flex: none;
}

.e6a-input {
  flex: 1;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 4px 8px;
  font-size: var(--ui-fs);
}
.e6a-input:focus { outline: none; border-color: var(--focus); }

.e6a-send {
  background: var(--accent);
  color: var(--accent-tx);
  border: none;
  border-radius: 2px;
  padding: 4px 14px;
  font-size: var(--ui-fs);
  cursor: pointer;
}
.e6a-send:hover { background: var(--accent-hi); }
.e6a-send:disabled { opacity: .5; cursor: default; }

/* ---- S-0000-0421: the result of a finished run, and the notice when it ends ---------- */
.e6a-result {
  margin: 6px 0 8px;
  padding: 6px 8px;
  border-left: 3px solid var(--ok, #3fb950);
  background: var(--surface2);
  border-radius: 3px;
}
.e6a-result.bad { border-left-color: var(--danger); }
.e6a-result-head { font-weight: 600; margin-bottom: 2px; }
.e6a-result-line { color: var(--text); }
.e6a-file { color: var(--accent, #4fa3ff); text-decoration: none; cursor: pointer; }
.e6a-file:hover { text-decoration: underline; }
.e6a-donestack {
  position: fixed;
  left: calc(var(--side-w) + 16px);
  bottom: 40px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
  pointer-events: none;
}
.e6a-donecard {
  background: var(--surface2);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--ok, #3fb950);
  border-radius: 3px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .35);
  padding: 8px 10px;
  pointer-events: auto;
}
.e6a-donecard.bad { border-left-color: var(--danger); }
.e6a-donehead { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.e6a-donekind { font-size: calc(var(--ui-fs) * 10 / 13); letter-spacing: .04em; text-transform: uppercase; color: var(--text-dim); }
.e6a-doneticket { font-family: var(--font-code); font-size: calc(var(--ui-fs) * 11 / 13); color: var(--syn-ident); }
.e6a-doneclose { margin-left: auto; background: none; border: 0; color: var(--text-dim); cursor: pointer; font-size: calc(var(--ui-fs) * 14 / 13); }
.e6a-donetext { margin-bottom: 6px; }
.e6a-doneactions { display: flex; gap: 6px; }
.e6a-donebtn { font: inherit; font-size: calc(var(--ui-fs) * 12 / 13); padding: 2px 8px; cursor: pointer; }
.e6a-donereport { margin-bottom: 6px; color: var(--text); font-size: calc(var(--ui-fs) * 12 / 13);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.e6a-donereport:empty { display: none; }

/* S-0000-0422: WHAT AN AGENT SAID IS TEXT YOU CAN SELECT. body is user-select: none
 * (core.css: the chrome is not a document), and this panel never turned it back on -- the
 * transcript, the question and the result could not be selected or copied at all. The
 * list of slots and the buttons stay unselectable: those are controls. */
.e6a-messages, .e6a-donetext, .e6a-donereport {
  -webkit-user-select: text; user-select: text;
  cursor: auto;
}
.e6a-gap { color: var(--text-dim); font-style: italic; }

/* ---- layer 1: one prompt line and Start (S-0000-0567) ---------------------------------- */
.e6a-prompt { display: flex; gap: 8px; align-items: center; padding: 8px 10px 6px; }
.e6a-prompt-in {
  flex: 1; min-width: 0; background: var(--surface2); color: var(--text-strong);
  border: 1px solid var(--rule); border-radius: 4px; padding: 6px 10px; font: var(--ui-fs) var(--font-ui);
}
.e6a-prompt-in:focus { outline: 1px solid var(--focus); border-color: var(--focus); }
.e6a-prompt-go { background: var(--accent); color: var(--accent-tx); border: 0; border-radius: 4px; padding: 6px 16px; font: var(--ui-fs) var(--font-ui); cursor: pointer; }
.e6a-prompt-go:hover { background: var(--accent-hi); }
.e6a-prompt-go:disabled { opacity: .6; }
/* S-0000-0575: Stop all -- only while agents run; a red outline, not a red block: it asks first */
.e6a-prompt-stopall { background: var(--surface2); color: var(--text); border: 1px solid var(--danger); border-radius: 4px; padding: 5px 10px; font: var(--ui-fs) var(--font-ui); cursor: pointer; white-space: nowrap; }
.e6a-prompt-stopall:hover { background: color-mix(in srgb, var(--danger) 18%, var(--surface2)); }
.e6a-prompt-stopall[hidden] { display: none; }
.e6a-prompt-more { background: var(--surface2); color: var(--text); border: 1px solid var(--rule); border-radius: 4px; padding: 5px 10px; font: var(--ui-fs) var(--font-ui); cursor: pointer; white-space: nowrap; }
.e6a-prompt-msg { padding: 0 12px 6px; color: var(--text); }
.e6a-prompt-msg.bad { color: var(--danger-tx); }
.e6a-more[hidden] { display: none; }

/* S-0000-0537: what the agent is doing now, on top of STEPS; orange when a step takes long */
.e6a-stepnow { display: flex; align-items: baseline; gap: 8px; margin: 6px 0 10px 0; padding: 8px 10px; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface2); font-size: calc(var(--ui-fs) * 1.1); }
.e6a-stepnow-kind { color: var(--text-dim); white-space: nowrap; }
.e6a-stepnow-what { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-code); }
.e6a-stepnow-time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.e6a-stepnow.long { border-color: var(--attn); background: color-mix(in srgb, var(--attn) 16%, var(--surface2)); }
.e6a-stepnow.long .e6a-stepnow-time { color: var(--attn); font-weight: 600; }
.e6a-steplist { margin: 0 0 10px 0; max-height: 40vh; overflow-y: auto; }
.e6a-steprow { display: flex; gap: 8px; align-items: baseline; padding: 2px 10px; }
.e6a-steprow-kind { color: var(--text-dim); min-width: 5.5em; white-space: nowrap; }
.e6a-steprow-what { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-code); }
.e6a-steprow-more { color: var(--text-dim); padding: 2px 10px; font-style: italic; }

/* S-0000-0567: a card per agent in simple mode (the mockup of DEC-0000-0178) */
.e6a-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; padding: 8px 0; align-content: start; }
.e6a-cards[hidden] { display: none; }
.e6a-cards-empty { color: var(--text-dim); padding: 10px 2px; }
.e6a-card { border: 1px solid var(--rule); border-radius: 6px; background: var(--surface2); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.e6a-card.wait { border-color: var(--attn); }
.e6a-card-name { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text-strong); min-width: 0; }
.e6a-card-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.e6a-card-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--text-dim); }
.e6a-card.run .e6a-card-dot { background: var(--ok); }
.e6a-card.wait .e6a-card-dot { background: var(--attn); }
.e6a-card.done .e6a-card-dot { background: var(--accent-hi); }
.e6a-card.fail .e6a-card-dot { background: var(--danger); }
.e6a-card-state { color: var(--text-dim); }
.e6a-card.wait .e6a-card-state { color: var(--attn); }
.e6a-card-line { color: var(--text); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; word-break: break-word; }
.e6a-card-acts { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.e6a-card-btn { background: var(--surface2); color: var(--text); border: 1px solid var(--rule); border-radius: 4px; padding: 4px 12px; font: var(--ui-fs) var(--font-ui); cursor: pointer; }
.e6a-card-btn.primary { background: var(--accent); color: var(--accent-tx); border-color: var(--accent); }
.e6a-steprow-dur { margin-left: auto; padding-left: 10px; color: var(--text-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.e6a-steprow.failed .e6a-steprow-dur { color: var(--danger-tx); }
