/* Trabajos de Roady: what runs now (live cards), what just ended (rows). */
.jobs-head { align-items: flex-end; }
.jobs-status { margin: 0; color: var(--color-text-muted); font-size: var(--text-sm); }

.jobs-h {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 28px 0 12px;
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
}
.jobs-count:empty { display: none; }
.jobs-count {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--color-moss);
  color: var(--color-paper);
  font-size: var(--text-xs);
  text-align: center;
}

.jobs-empty {
  margin: 0;
  padding: 18px;
  border: 1px dashed var(--color-line);
  border-radius: 14px;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.jobs-running { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.jobs-running:empty { display: none; }

.jobs-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 18px 16px;
  border: 1px solid color-mix(in srgb, var(--color-moss) 40%, transparent);
  border-radius: 16px;
  background: var(--color-paper);
}
.jobs-card[data-state="quiet"] { border-color: color-mix(in srgb, var(--color-warn) 60%, transparent); }
.jobs-card-head { display: flex; align-items: flex-start; gap: 10px; }
.jobs-title { margin: 0; font-size: var(--text-md); font-weight: var(--weight-semibold); line-height: 1.35; }

.jobs-pulse {
  position: relative;
  flex: none;
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--color-moss);
}
.jobs-pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--color-moss);
  opacity: 0;
  animation: jobs-pulse 1.8s ease-out infinite;
}
.jobs-card[data-state="quiet"] .jobs-pulse,
.jobs-card[data-state="quiet"] .jobs-pulse::after { background: var(--color-warn); border-color: var(--color-warn); }
@keyframes jobs-pulse {
  0% { transform: scale(0.6); opacity: 0.7; }
  100% { transform: scale(1.6); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .jobs-pulse::after { animation: none; }
}

.jobs-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}
.jobs-chip {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--color-moss-weak);
  color: var(--color-moss);
  font-weight: var(--weight-medium);
}

.jobs-clock { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0; font-size: var(--text-sm); }
.jobs-clock span { color: var(--color-text-muted); }

.jobs-progress {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--color-ink-850);
}
.jobs-progress p { margin: 0; }
.jobs-progress-text { font-size: var(--text-sm); line-height: 1.45; }
.jobs-progress-text.is-empty { color: var(--color-text-muted); }
.jobs-progress-at { margin-top: 4px !important; color: var(--color-text-faint); font-size: var(--text-xs); }
.jobs-quiet { margin-top: 6px !important; color: var(--color-warn-ink); font-size: var(--text-xs); font-weight: var(--weight-medium); }

.jobs-open {
  align-self: flex-start;
  color: var(--color-moss);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  text-decoration: none;
}
.jobs-open::after { content: " ↗"; }
.jobs-open:hover { text-decoration: underline; }

.jobs-done { display: flex; flex-direction: column; border: 1px solid var(--color-line); border-radius: 14px; background: var(--color-paper); overflow: hidden; }
.jobs-done:empty { display: none; }
.jobs-row + .jobs-row { border-top: 1px solid var(--color-line); }
.jobs-row-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
}
.jobs-row-head::-webkit-details-marker { display: none; }
.jobs-row-head:hover { background: var(--color-ink-850); }
.jobs-row-title { overflow: hidden; font-size: var(--text-sm); text-overflow: ellipsis; white-space: nowrap; }
.jobs-row[open] .jobs-row-title { white-space: normal; }
.jobs-row-when { color: var(--color-text-muted); font-size: var(--text-xs); white-space: nowrap; }
.jobs-pill {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--color-ink-700);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  white-space: nowrap;
}
.jobs-row[data-state="done"] .jobs-pill { background: var(--color-moss-weak); color: var(--color-moss); }
.jobs-row[data-state="failed"] .jobs-pill { background: color-mix(in srgb, var(--color-danger) 14%, transparent); color: var(--color-danger); }
.jobs-row-body { display: flex; flex-direction: column; gap: 10px; padding: 0 16px 16px; }
.jobs-result { margin: 0; font-size: var(--text-sm); line-height: 1.5; white-space: pre-wrap; }
.jobs-result.is-empty { color: var(--color-text-muted); }

@media (max-width: 640px) {
  .jobs-running { grid-template-columns: 1fr; }
  .jobs-row-head { grid-template-columns: auto 1fr; }
  .jobs-row-when { grid-column: 2; }
}
