/* Optional inputs and collaborators belong beside the task, not in an infrastructure dashboard. */
.draft-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px 0 12px;
}
.source-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 2px 4px 2px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-subtle);
  font-size: 12.5px;
}
.source-chip[data-state="uploading"] {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}
.source-chip[data-state="uncertain"] {
  border-color: color-mix(in srgb, var(--warn) 45%, var(--line));
  background: var(--warn-bg);
}
.source-chip > .icon {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--text-3);
}
.source-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.source-chip .icon-button {
  flex: none;
  width: var(--target);
  height: var(--target);
}
.source-status {
  margin: 8px 8px 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.source-status:empty {
  display: none;
}
.source-dialog {
  --dialog-width: 560px;
}
.source-dialog-body {
  display: grid;
  gap: 16px;
  min-height: 0;
  padding: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.source-url-form {
  display: grid;
  gap: 8px;
  padding-block: 8px 16px;
  border-bottom: 1px solid var(--line);
}
.source-url-form label,
.repository-list-head h3 {
  font-size: 13px;
  font-weight: 550;
}
.source-url-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.source-url-row input {
  flex: 1;
  min-width: 0;
}
.repository-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.repository-list {
  display: grid;
  gap: 8px;
}
.repository-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 10px;
  width: 100%;
  min-height: 52px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-subtle);
  text-align: left;
}
.repository-row:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--line-strong);
}
.repository-row:active:not(:disabled) {
  background: var(--bg-active);
}
.repository-row:disabled {
  color: var(--text-3);
  opacity: 0.6;
}
.repository-row > .icon {
  width: 17px;
  height: 17px;
  color: var(--accent);
}
.repository-row strong {
  font-size: 13.5px;
  font-weight: 550;
  overflow-wrap: anywhere;
}
.repository-row > span:not(.icon) {
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-3);
}
.repository-row p {
  grid-column: 2 / -1;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.agent-activity {
  margin-block: 0 12px;
  font-size: 12.5px;
  color: var(--text-2);
}
.agent-activity > summary,
.question-history > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: var(--target);
  padding: 4px 0;
  list-style: none;
  cursor: pointer;
}
.agent-activity > summary::-webkit-details-marker,
.question-history > summary::-webkit-details-marker {
  display: none;
}
.agent-activity > summary .icon,
.question-history > summary .icon {
  width: 14px;
  height: 14px;
}
.agent-activity[open] > summary .chev,
.question-history[open] > summary .chev {
  rotate: 90deg;
}
.agent-list {
  display: grid;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}
.agent-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-subtle);
}
.agent-name {
  justify-self: start;
  min-height: var(--target);
  max-width: 100%;
  padding: 0 4px;
  margin-left: -4px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  text-align: left;
  font-weight: 550;
  overflow-wrap: anywhere;
}
.agent-name:hover {
  background: var(--bg-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.agent-detail-body {
  min-height: 0;
  padding: 24px;
  overflow: auto;
  overscroll-behavior: contain;
}
.agent-detail-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 12px 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.agent-detail-toolbar .panel-status {
  flex: 1;
  min-width: 180px;
  margin: 0;
}
.agent-row strong {
  font-weight: 550;
  overflow-wrap: anywhere;
}
.agent-row > span {
  font-size: 11px;
  color: var(--text-3);
}
.agent-row > span[data-state="running"] {
  color: var(--accent);
  background: var(--accent-soft);
}
.agent-row p {
  grid-column: 1 / -1;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.question-card {
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 12px;
  background: var(--accent-soft);
}
.question-card[data-state]:not([data-state="waiting"]) {
  border-color: var(--line);
  background: var(--bg-subtle);
}
.question-card h3 {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}
.question-card .plain {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.question-card textarea {
  display: block;
  width: 100%;
  resize: vertical;
  min-height: 72px;
  max-height: 160px;
  padding: 12px;
  margin: 12px 0;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--text);
  background: var(--bg-raised);
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
}
.question-card textarea:focus-visible {
  border-color: var(--accent);
}
.question-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.question-card .panel-status {
  margin: 10px 0 0;
  font-size: 12.5px;
}
#owner-questions {
  max-height: 40dvh;
  overflow: auto;
  padding: 3px;
  margin-block: -3px 0;
}
.question-history > summary {
  color: var(--text-2);
  font-size: 12.5px;
}
@media (max-width: 640px) {
  .source-dialog-body,
  .agent-detail-body {
    padding: 16px 16px max(20px, env(safe-area-inset-bottom));
  }
  .question-card textarea {
    font-size: 16px;
  }
}
@media (max-width: 480px) {
  .repository-row {
    grid-template-columns: 18px minmax(0, 1fr);
  }
  .repository-row > span:not(.icon) {
    grid-column: 2;
    justify-self: start;
  }
}
