/* Automations. A sequence reads better as a numbered list than as a diagram,
   and what matters most is who is in it right now. */

.pa-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pa-card h3 { margin: 0; font-size: 15.5px; }
.pa-card p { margin: 4px 0 0; font-size: 13px; color: var(--sd-mut); line-height: 1.5; }
.pa-trigger { font-size: 12.5px; color: var(--sd-mut); }

.pa-steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.pa-steps li { display: flex; align-items: baseline; gap: 8px; }
.pa-step-n {
  flex: none; width: 19px; height: 19px; border-radius: 50%; display: inline-grid; place-items: center;
  font-size: 11px; background: rgba(47,109,246,.1); color: #2f6df6; font-weight: 600;
}

.pa-figures { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--sd-mut); }
.pa-figures b { color: inherit; font-size: 14px; font-weight: 650; margin-right: 3px; }
.pa-card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.pa-card-actions .pa-btn { padding: 6px 10px; font-size: 12.5px; }

.pa-badge.live, .pa-badge.completed { color: #15803d; border-color: rgba(21,128,61,.35); background: rgba(21,128,61,.08); }
.pa-badge.running { color: #1d4ed8; border-color: rgba(29,78,216,.35); background: rgba(29,78,216,.08); }
.pa-badge.paused { color: #b45309; border-color: rgba(180,83,9,.35); background: rgba(180,83,9,.08); }
.pa-badge.stopped, .pa-badge.failed { color: #b91c1c; border-color: rgba(185,28,28,.35); background: rgba(185,28,28,.08); }

/* Editor */
.pa-modal { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 20px; }
.pa-backdrop { position: absolute; inset: 0; border: 0; background: rgba(8,10,16,.55); backdrop-filter: blur(2px); cursor: pointer; }
.pa-dialog {
  /* The dialog itself must not scroll. A scrolling box clips what opens
     inside it, and a select sitting near its bottom edge had nowhere to
     open into — the list appeared cut off. The body scrolls instead, and
     it leaves room below so a dropdown always has somewhere to go. */
  position: relative; width: min(720px, 100%); max-height: 88vh;
  display: flex; flex-direction: column; overflow: visible;
  padding: 26px 28px;
  border: 1px solid var(--sd-line); box-shadow: 0 24px 60px rgba(8,10,16,.28);
}
.pa-dialog-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  /* Room under the last control so its dropdown is not pressed against the
     edge of the scrolling area. */
  padding-bottom: 8px;
}
.pa-dialog.wide { width: min(1000px, 100%); }
.pa-dialog h4 { margin: 22px 0 10px; font-size: 13px; }
.pa-close { position: absolute; top: 14px; right: 14px; border: 0; background: transparent; font-size: 15px; cursor: pointer; color: var(--sd-mut); }
.pa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pa-grid .full { grid-column: 1 / -1; }

.pa-step-list { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 12px; }
.pa-step-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pa-step-row .pa-input { width: auto; min-width: 160px; flex: 1 1 160px; }
.pa-step-row .pa-btn { padding: 6px 10px; font-size: 12.5px; }
.pa-values {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end;
  margin-top: 8px; padding: 10px 12px; border-left: 2px solid rgba(127,137,158,.3);
  background: rgba(127,137,158,.06); border-radius: 0 9px 9px 0; font-size: 11.5px; color: var(--sd-mut);
}
.pa-values > span { align-self: center; }
.pa-values label { display: flex; flex-direction: column; gap: 4px; }
.pa-values .pa-input { min-width: 230px; padding: 6px 9px; font-size: 12.5px; }

.pa-problems {
  border: 1px solid rgba(180,83,9,.35); background: rgba(180,83,9,.08); color: #b45309;
  border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; font-size: 13px; line-height: 1.5;
}
.pa-problems ul { margin: 6px 0 0; padding-left: 18px; }
/* Outside the scrolling body, so Save is always reachable without scrolling. */
.pa-modal-actions {
  display: flex; align-items: center; gap: 9px;
  margin-top: 16px; padding-top: 16px; flex: none;
  border-top: 1px solid var(--sd-line);
}

.pa-log { margin: 0; padding-left: 16px; color: var(--sd-mut); font-size: 12px; max-width: 44ch; }

@media (max-width: 760px) {
  .pa-grid { grid-template-columns: 1fr; }
}
/* A step that is not finished yet, so it does not read as ready. */
.pa-unset { color: #b45309; }
html[data-theme="dark"] { .pa-unset { color: #fbbf24; } }
