.ai-manage-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin: 0 0 12px;
}

.ai-manage-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin: 0 0 14px;
}

.ai-manage-project-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.9rem;
}

.ai-manage-project-filter-label {
  color: var(--muted, #667);
  white-space: nowrap;
}

.ai-manage-project-filter select {
  min-width: 11rem;
  max-width: 18rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  color: inherit;
}

.ai-manage-filters {
  margin: 0;
}

.ai-manage-count {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 5.5rem;
}

.ai-manage-count-btn {
  border: none;
  background: transparent;
  padding: 4px 6px;
  margin: -4px -6px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
}

.ai-manage-count-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}

.ai-manage-count-btn.ai-manage-count-active {
  background: rgba(37, 99, 235, 0.1);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.35);
}

.ai-manage-count-btn.ai-manage-count-active .ai-manage-count-num {
  color: #1d4ed8;
}

.ai-manage-count-label {
  color: var(--muted, #667);
  font-size: 0.85rem;
}

.ai-manage-count-num {
  font-size: 1.25rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.ai-manage-table-wrap {
  overflow-x: auto;
}

.ai-manage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.ai-manage-table th,
.ai-manage-table td {
  text-align: left;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  vertical-align: top;
}

.ai-manage-table th {
  font-weight: 600;
  color: var(--muted, #556);
  white-space: nowrap;
}

.ai-manage-title {
  max-width: 28rem;
  word-break: break-word;
}

.ai-manage-project {
  display: inline-block;
  max-width: 9.5rem;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.3;
  background: rgba(15, 23, 42, 0.06);
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.ai-manage-status {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.06);
}

.ai-manage-status.is-waiting {
  background: rgba(120, 120, 40, 0.12);
  color: #6a5a00;
}

.ai-manage-status.is-running {
  background: rgba(30, 100, 200, 0.12);
  color: #1554a8;
}

.ai-manage-status.is-running.ai-manage-status-live {
  background: #dbeafe;
  color: #1d4ed8;
  box-shadow: 0 0 0 1px rgba(29, 78, 216, 0.28);
}

.ai-manage-row-processing {
  background: rgba(37, 99, 235, 0.06);
}

.ai-manage-row-processing td:first-child {
  box-shadow: inset 3px 0 0 #2563eb;
}

.ai-manage-processing-mark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 8px 4px 0;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.2;
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid rgba(29, 78, 216, 0.22);
  vertical-align: middle;
  white-space: nowrap;
}

.ai-manage-status.is-failed {
  background: rgba(200, 40, 40, 0.12);
  color: #a01818;
}

.ai-manage-status.is-done {
  background: rgba(30, 140, 70, 0.12);
  color: #1a7a3c;
}

.ai-manage-engine {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.06);
  color: #445;
  white-space: nowrap;
}

.ai-manage-engine.is-ollama {
  background: rgba(40, 120, 90, 0.14);
  color: #1d6b4a;
}

.ai-manage-engine.is-codex {
  background: rgba(90, 60, 160, 0.12);
  color: #5a3a9a;
}

.ai-manage-engine.is-cursor {
  background: rgba(40, 90, 140, 0.12);
  color: #2a5a8a;
}

.ai-manage-dummy {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--muted, #778);
  border: 1px dashed rgba(0, 0, 0, 0.12);
  border-radius: 8px;
}

#ai-engineer-poll-hint.error {
  color: #a01818;
}

@media (max-width: 640px) {
  .ai-manage-title {
    max-width: 14rem;
  }
}
